Skip to content

Commit

Permalink
[TH2-5164] Raw message in ASCII display mode has incorrect character …
Browse files Browse the repository at this point in the history
…if the content is in UTF8 (#566)
  • Loading branch information
tesohi authored Feb 15, 2024
1 parent 774aaf7 commit 12d7dbe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "th2-rpt-viewer",
"version": "5.1.26",
"version": "5.1.27",
"description": "",
"main": "index.tsx",
"private": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface Props {
export default function SimpleMessageRaw({ rawContent }: Props) {
const contentRef = React.useRef<HTMLDivElement>(null);

const humanReadableContent = atob(rawContent);
const humanReadableContent = decodeURIComponent(escape(atob(rawContent)));
const convertedArr = splitOnReadableParts(humanReadableContent);

return (
Expand Down
4 changes: 3 additions & 1 deletion src/helpers/rawFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export function decodeBase64RawContent(rawBase64Content: string): string[][] {
const offset = [];
const hexadecimal = [];
const humanReadable = [];
const raw = Uint16Array.from(atob(rawBase64Content), c => c.charCodeAt(0));
const raw = Uint16Array.from(decodeURIComponent(escape(atob(rawBase64Content))), c =>
c.charCodeAt(0),
);
let index = 0;
const { length } = raw;
while (index < length) {
Expand Down

0 comments on commit 12d7dbe

Please sign in to comment.