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
I am not sure why we cannot work without strings in these methods and thus avoid having to create strings while talking to the library. Imho everything here should be Uint8Array based and not string based at all.
The text was updated successfully, but these errors were encountered:
This is in line with StreamDecoder in Node.js and TextDecoder/TextEncoder in WHATWG Encodings standard. Conceptually encoding/decoding is a conversion between bytes and strings and in vast majority of cases it makes sense to expose strings to clients. In rare cases where you convert from bytes in encoding A to bytes in encoding B, we recommend just calling encode(decode()) or piping the streams.
Also, btw, Node.js streams can also work with strings just fine, using "object" mode.
Referring to:
iconv-lite/lib/index.d.ts
Lines 33 to 41 in 148b6bc
I am not sure why we cannot work without strings in these methods and thus avoid having to create strings while talking to the library. Imho everything here should be
Uint8Array
based and notstring
based at all.The text was updated successfully, but these errors were encountered: