Is this your first time here? SwingWiki is a Java Swing Developer community site with an big archive of Swing-related usenet groups and mailing lists, but also tips, tricks and articles and book reviews written by your colleagues from around the world. If you came here through a search engine and did not find what you were looking for, make sure to check the wiki table of contents.

Re: UTF-8 in Swing app on Windows

From:Hendrik Maryns [gtw37bn02@masked-domain]
Sent on:Wed, 07 May 2008 14:05:16 +0200
In reply to:UTF-8 in Swing app on Windows sent on Wed, 07 May 2008 13:46:49 +0200 by Hendrik Maryns [gtw37bn02@masked-domain]
Hendrik Maryns wrote:
> Hi,
>
> I have a Swing application which runs fine on Linux, showing some UTF-8
> symbols outside of the usual range fine. However, on Win2000, these
> show up as the usual strange symbols. So obviously, the strings are
> interpreted as cp1252.
>
> How can I set it to use the proper symbols?
>
> This only happens with the native look and feel, if I choose the default
> cross-platform one, the menu’s show up fine.
>
> However, there is some text I read in and display as well, which gets
> garbled all the same. How to fix this?

Hm, seems to work now, strangely, although the only thing I changed was
a fix to my second question:

final BufferedReader queriesF = new BufferedReader(new
InputStreamReader(new FileInputStream(selectedFile), "UTF-8"));

instead of

final BufferedReader queriesF = new BufferedReader(new
FileReader(selectedFile)));

Ah well, H.
Found what you were looking for? If not - continue at Wiki Index

Other messages in this topic

SenderDate sentSubject
Roedy Green [see_website@masked-domain]Wed, 07 May 2008 13:53:18 GMTRe: UTF-8 in Swing app on Windows
Hendrik Maryns [gtw37bn02@masked-domain]Wed, 07 May 2008 13:46:49 +0200UTF-8 in Swing app on Windows

 
Recent changes | RSS changes | Table of contents | News Archive | Terms And Conditions | Register | The Quest For Software++| Ruby Resources
FitNesse Resources