:echo blob2str(0z480065006C006C006F00, #{encoding: 'utf-16le'})
['H
e
l
l
o
']
['Hello']
9.1.2089
Ubuntu 24.04.3
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
From h blob2str()
Each <NL> byte in the blob is interpreted as the end of a
string and a new list item is added. Each <NUL> byte in the
blob is converted into a <NL> character.
What!?
I think 0z4800 is the correct character code for H in 'utf-16le'...
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
@h-east This is a bug. The current implementation of blob2str() and str2blob() doesn't handle these encodings correctly.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
working on this bug
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
This bug is troublesome. enc_canonize drops endianness information, convert_setup_ext incorrectly handles UTF-16 and UTF-8, and f_blob2str fails to append the two-byte NUL for UTF-16. (I already have a patch for this)
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()