Skip to content

The custom glyphs does not seem to render correctly. #4303

Answered by jerch
HichamELBSI asked this question in Q&A
Discussion options

You must be logged in to vote

Those ─ are an double encoding issue at the task, that creates your logs.txt, means that file is already wrongly encoded/corrupted. xterm.js understands JS strings (which are utf-16 under the hood) or byte sequences (utf-8 bytes) as input.

What could cause the issue in the first place? Well, whoever writes the log file entries, prolly gets utf-8 bytes as input, but decodes them wrongly with an 8bit encoding, then re-encodes them as utf-8, example:

>>> original_char =  '─'
>>> incoming_bytes = original_char.encode('utf-8')
>>> incoming_bytes
b'\xe2\x94\x80
>>> corrupted_bytes = incoming_bytes.decode('cp1252').encode('utf-8')
>>> # now corrupted_bytes get saved to your file
>>> # then the…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Tyriar
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type/question A question on how to use the library
2 participants
Converted from issue

This discussion was converted from issue #4300 on December 11, 2022 19:31.