You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throws if the fromEnc or toEnc specify invalid character encodings or if conversion from fromEnc to toEnc is not permitted.
However, the documentation does not specify which encodings are valid.
(I was trying to transcode a Buffer into a Buffer with the same bytes, base64 encoded. My goal was to replace the + and / characters with - and _ without needing to create an entirely new string or call .replace).
At least one character encoding specified there ('base64') is not valid for buffer.transcode; when you try to use it an error is thrown. It would be good to know if there are others without having to read the source code, or write demonstration code enumerating the possible encoding pairs.
Activity
TimothyGu commentedon Sep 27, 2017
There is a section in that document specifically about character encodings.
kevinburke commentedon Sep 27, 2017
At least one character encoding specified there (
'base64') is not valid forbuffer.transcode; when you try to use it an error is thrown. It would be good to know if there are others without having to read the source code, or write demonstration code enumerating the possible encoding pairs.kevinburke commentedon Sep 27, 2017
If you like I could rename this ticket "buffer.transcode should support base64" which would remove the confusion.
doc: list encodings supported by buffer.transcode
doc: list encodings supported by buffer.transcode
doc: list encodings supported by buffer.transcode
doc: list encodings supported by buffer.transcode