From f7090b6efeb9f7b79e4acd7d5d363e6fb4f81467 Mon Sep 17 00:00:00 2001 From: serega6531 Date: Mon, 28 Dec 2020 22:14:18 +0300 Subject: [PATCH] Fix unicode in packets --- src/components/Packet.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/Packet.vue b/src/components/Packet.vue index d07df53..1c91101 100644 --- a/src/components/Packet.vue +++ b/src/components/Packet.vue @@ -32,14 +32,14 @@ }, computed: { hexdata() { - const dataString = atob(this.packet.content); + const dataString = this.atou(this.packet.content); const dump = this.hexdump(dataString, this.$store.state.hexdumpBlockSize, this.$store.state.hexdumpLineNumberBase); return this.escapeHtml(dump) .split('\n') .join('
'); // Replace all \n to
}, stringdata() { - const dataString = atob(this.packet.content); + const dataString = this.atou(this.packet.content); const dump = this.highlightPatterns(dataString); return this.escapeHtml(dump) .split('\n') @@ -47,6 +47,9 @@ }, }, methods: { + atou(b64) { + return decodeURIComponent(escape(atob(b64))); + }, printPacketFlags(packet) { let flags = [];