3 ms·
The C code there fails if the unicode string includes characters whose width is greater than one octet.
by Sir_Cmpwn 11y ago
The C code there fails if the unicode string includes characters whose width is greater than one octet.
- zokier 11y agoWhich is noted right in the post: > This treats things as byte-array instead of unicode, thus for unicode test it will end up printing just 車賈滑豈.
- rakoo 11y agoWhich is useless then, because the output can't safely be considered a string anymore. I don't really see the point of writing the C "equivalent" and giving it any point when it doesn't even do the right thing.
- masklinn 11y agoNone of the snippets comes even remotely close to doing the right thing so it doesn't really matter.