[plt-scheme] Why do MzScheme ports not respect the locale's encoding by default?
Alex Shinn <foof at synthcode.com> writes:
> I'm honestly puzzled as to what could be hard to use about it. I
> consider the C model downright painful to use.
The Japanese hiragana character 'A' followed by the latin character
'a' is encoded in iso-2022-jp as the following sequence of bytes (in
hex):
#x1b #x24 #x42 #x24 #x22 #x1b #x28 #x42 #x61
That's:
- an "ESC $ B" to get into the two-byte-per-char mode,
- the two bytes #x24 and #x22, indicating the hiragana 'A',
- an "ESC ( B" to get back into the single-byte ASCII mode,
- the single byte #x61, indicating the latin character 'a'.
In your implementation, if I read a character, and then a byte, which
character and byte do I get?