| Issue 159: | StringBuf.addChar assume UTF8 | |
| 1 person starred this issue and may be notified of changes. | Back to list |
StringBuf.addChar(0x80) will encode the char into UTF8 because it uses String.fromCharCode. I'm not sure if String.fromCharCode should encode in UTF8 if the native String class does not enforce UTF8. At lease that's not the case for PHP/Neko We could add haxe.Utf8.fromCharCode that does that.
Mar 15, 2012
Project Member
#1
gameh...@gmail.com
Mar 21, 2012
Well, as for the String-to-bytes it feels normal to use use the actual binary representation of the string (raw on Neko/CPP/PHP, UTF8 on JS/Flash). At least that's what haxe.io.Bytes.ofString does
Mar 22, 2012
It is ok if you think of C "char *" - but what about characters over 255? Users have to know that String is a string of "signed char", not arbitrary characters, so utf8 -> "unsigned char" is a lossy operation.
Apr 5, 2012
I have conformed this to the neko api, so it should be good for building up strings from bytes without assuming utf8.
Status:
Fixed
|