osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: Re: Problem outputting utf-8 from java - msg#00085

List: internationalization.linux

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index

Hi,

thanks for your quick answer.

> Check with "locale charmap" what the encoding of the currently
> set locale is. You should get "ISO-8859-1" with SuSE 7.0 and
> "ISO 8859-15" with SuSE 7.2 for "LANG=de_DE". You should get
> "UTF-8" for "LANG=de_DE.UTF-8".
I get ISO-8859-1 all right.

> If that is all right, then probably your application or JVM is broken and
> does not check the locale correctly with "nl_langinfo(CODESET)". File a
> bug report to whoever wrote it or check the source code how the output
> charset is determined. May be some Java expert here knows more.
Mhh, when I print out the default locale from my java program, it says de_DE
as well.

Still thinking about it.

Thanks, Heike

-
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/



Thread at a glance:

Previous Message by Date:

Re: Problem outputting utf-8 from java

Heike Franosch writes: > What really is worrying me is that when I write > it to a db it still is encoded. What do you mean by "write it to a db"? If you take the file as a byte sequence, without processing by a Reader/Writer, its encoding will be unchanged. The FileReader/FileWriter use the locale's encoding, i.e. ISO-8859-1 in your case. > If that is all right, then probably your application or JVM is broken and > does not check the locale correctly with "nl_langinfo(CODESET)". The Sun JDK 1.3 on Linux, in locale de_DE, knows that the locale encoding is ISO-8859-1. Even with glibc-2.1.x. I verified that. Bruno - Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/

Next Message by Date:

Re: Problem outputting utf-8 from java

Hi Bruno, thanks for your answer. > What do you mean by "write it to a db"? If you take the file as a byte > sequence, without processing by a Reader/Writer, its encoding will be > unchanged. The FileReader/FileWriter use the locale's encoding, i.e. > ISO-8859-1 in your case. To be precise, I do some XPath queries and pick out single values, put them all together in an sql query and write them to a db with jdbc. And you are right, the encoding is unchanged. Again this points to a locale problem .... When I wright a little test program, just outputting a string with german umlauts, my linux box does it as expected. Principally it knows its locale all right. Thanks, Heike - Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/

Previous Message by Thread:

Re: Problem outputting utf-8 from java

Heike Franosch writes: > What really is worrying me is that when I write > it to a db it still is encoded. What do you mean by "write it to a db"? If you take the file as a byte sequence, without processing by a Reader/Writer, its encoding will be unchanged. The FileReader/FileWriter use the locale's encoding, i.e. ISO-8859-1 in your case. > If that is all right, then probably your application or JVM is broken and > does not check the locale correctly with "nl_langinfo(CODESET)". The Sun JDK 1.3 on Linux, in locale de_DE, knows that the locale encoding is ISO-8859-1. Even with glibc-2.1.x. I verified that. Bruno - Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/

Next Message by Thread:

Re: Problem outputting utf-8 from java

Hi Bruno, thanks for your answer. > What do you mean by "write it to a db"? If you take the file as a byte > sequence, without processing by a Reader/Writer, its encoding will be > unchanged. The FileReader/FileWriter use the locale's encoding, i.e. > ISO-8859-1 in your case. To be precise, I do some XPath queries and pick out single values, put them all together in an sql query and write them to a db with jdbc. And you are right, the encoding is unchanged. Again this points to a locale problem .... When I wright a little test program, just outputting a string with german umlauts, my linux box does it as expected. Principally it knows its locale all right. Thanks, Heike - Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!