[jdev] Using german umlauts and other special characters in jabber client

maqi at jabberstudio.org maqi at jabberstudio.org
Fri Oct 15 05:09:13 CDT 2004


On Fri, 15 Oct 2004, Jana von dem Berge wrote:

> Thancs for the reply! But I have not declared another encoding. I think
> UTF-8 "knows" the german umlauts, is that wrong?

Using this
>>> recv(j->fd, buf, sizeof(buf)-1, 0); (language c)
you read an UTF-8 encoded string into buf. Then you probably do a printf
or something. However, printf doesn't know anything about encodings.
Therefore, the UTF-8 encoded string will be written without any conversion
to a console that probably doesn't use the UTF-8 encoding which breaks all
special characters.

BTW in more modern programming languages (for example Java) the String
variable type/class knows its encoding. Therefore, using these languages
such problems do not arise.

Regards



More information about the JDev mailing list