[plt-scheme] Unicode on the cheap

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Jan 25 10:00:22 EST 2004

At Sun, 25 Jan 2004 08:35:29 -0600, Robby Findler wrote:
>   If I were to put four of those chinese characters into string (eg by
>   calling `string' with four arguments), why wouldn't the resulting
>   string have a `string-length' of four?

If you create a string by calling `string' with four arguments, then
`string-length' reports 4. Each of the four arguments to `string' is a
"char" (and therefore a code unit or #\377 or #\376).

But you can't create a string containing four Chinese characters by
calling `string' with four arguments, because each Chinese character
requires three "char"s.

Matthew



Posted on the users mailing list.