Hi,
seeing that there is a discussion about the encoding of Unicode input
messages, I would like to address a slightly related issue regarding
the encoding of window captions for the function SDL_WM_SetCaption().
I have problems with the display of special characters in window
captions. For example, if I like to display the German umlaut "o (o
diaeresis) I have to write it
- in ANSI encoding (or Latin1?) on Windows: “\xF6”
- in UTF-8 encoding on Mac OS X: "\xC3\xB6"
On Linux I could not figure out a way which works reliably. Sometimes
it works if I write the "o as plain text in the sourcecode, sometimes
the UTF-8 encoding looks promising, but it is also possible that I
cannot get it to work at all. From a glance at the SDL sources I see
that it depends whether the library has been compiled with Unicode
support in X (macro X_HAVE_UTF8_STRING) but I can see no way how to
figure that out in my program. It also seems to me that the used
windowmanager influences the result.
I can imagine two possible solutions for this: either, the API is
changed such that the caption for SDL_WM_SetCaption() is always in a
fixed encoding (maybe UTF-8?), but then of course recoding the string
on systems that do not support UTF-8 captions is necessary. Or, there
is a function which can tell at runtime the required encoding of
caption strings.
Well, the display of special characters in window captions is probably
also a special problem that occurs not very often, but I am interested
if there is a way to solve my problem.
Regards, Christoph–
_ http://wormsofprey.org
__ __ __ __ __ __ | __ __ ___
((( () | ’ | ) ) ) () | |) | ’ (/_ (|
The new and free real-time Worms game | |