Commit 45aa8d2
fix(frontend): preserve \u00XX escapes in Avro JSON viewer
Avro's JSON encoding represents bytes/fixed as ISO-8859-1 code points
(\u00XX for anything above 0x7F). Running the normalized payload through
JSON.parse then JSON.stringify for display launders those escapes into
literal Unicode glyphs (e.g. Û -> U+00DB -> "Û"), so "Copy Value"
placed UTF-8 bytes on the clipboard instead of the original byte.
Scoped to payload.encoding === 'avro' only. KowlJsonView now re-escapes
code points in 0x80-0xFF back to \u00XX before display when called from
an avro payload view, which is lossless for both Avro bytes fields
(recovers the exact byte) and legitimate Latin-1 strings (valid JSON
escape for the same Unicode character). Non-avro encodings (proto, json,
text, etc.) are unchanged.
Fixes #2421.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 94449f4 commit 45aa8d2
2 files changed
Lines changed: 20 additions & 6 deletions
File tree
- frontend/src/components
- misc
- pages/topics/Tab.Messages/message-display
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
56 | 64 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
61 | 72 | | |
62 | 73 | | |
63 | 74 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
186 | 189 | | |
187 | 190 | | |
188 | 191 | | |
0 commit comments