[SDL] The keyboard in SDL

Mattias Karlsson betasoft at acc.umu.se
Mon Feb 5 03:13:51 PST 2007


On Sat, 3 Feb 2007, Christer Sandberg wrote:

> Now a new questions araises: I need a function similar to toupper()  that
> operates on Unicode, and I can find no such in  SDL. I have looked at it out
> there but can't find anything for C.
> Someone that has any clue where to start digging? (I realize that it is likely
> to find out how to do it reading the complete Unicode docs, but that is
> rather extensive)

My digging let me to belive that toupper()/tolower()/sorting is 
intentionaly left out since each locale has its own rules. IIRC the 
example given is 'ä' that in german is sorted together with 'a' but in swedish 
sorted as its own character.

So the only solution is to use "wchar.h", and note that wchar is 
UTF-16 on Windows and UTF-32 on most unices.


More information about the SDL mailing list