[SDL] The keyboard in SDL

Brian Raiter breadbox at muppetlabs.com
Mon Feb 5 18:22:31 PST 2007


> As far as I know UNICODE is a character representation designed for
> using in memory. It is a comfortable format because you can handle an array
> of UNICODE characters much like you handle a normal char array (characters
> use a fixed amount of bytes, multiple of 2, and the representation of each
> one is independent of the other characters around).

Of course, neither of those things are completely true.

Unicode values are 21 bits in size. So you usually need to a full 4
bytes for each character (i.e. UTF-32) in order to treat your string
as a "normal" array of characters. Most people prefer to use one of
the encodings that keep strings from getting too large (e.g. UTF-8,
UTF-16, or something higher-level like SCSU).

Also, Unicode contains a number of combining modifier characters (e.g.
accent marks). Their representations are affected by the character(s)
it modifies (depending on what exactly you mean by "representation").

b


More information about the SDL mailing list