Replies: 2 comments 1 reply
-
const latin1Buffer = buffer.transcode(Buffer.from(string), "utf8", "latin1");
const latin1String = latin1Buffer.toString(); This doesn't do what I think you think it does. toString() expects UTF-8 but there's no UTF-8 in latin1Buffer contains and that's why it returns those three Unicode "REPLACEMENT CHARACTER" (U+FFFD) characters. I'll convert this to a discussion. |
Beta Was this translation helpful? Give feedback.
1 reply
-
I found a way to do it; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version
v14.17.4
Platform
Linux desenvolvimentointerno 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
The expected behavior
What do you see instead?
The output terminal econding in LATIN1
The output terminal in UTF-8
Beta Was this translation helpful? Give feedback.
All reactions