JS strings (cstrings) are UTF-16, which means the cstring `items` iterator 
which returns chars needs to deal with UTF-16 on the JS backend somehow, since 
they can have "characters" bigger than Nim's `char` type allows. My guess is 
this is where the difference happens, but I am not sure if the cstring 
conversion gives `String.fromCodePoint(128, 0)` either.

Although 128-255 don't mean anything in UTF-16, so maybe these should be 
preserved when converting back.

Don't know why you want to convert to cstring here though. 

Reply via email to