joakimk
06-06-2007, 07:45 AM
I am working on a Java project (in NetBeans 5.5) under Linux (Fedora). When I enter some text into a JTextPane, the characters are displayed correctly -- including international chartacters like 'æ', 'ø', and 'å'.
The program is to be run on Knoppix, with the configurations (and home dir) stored on an USB disk. First off, in the terminal prompt, I am able to type accented characters, so it seems the System is configured correctly (under Keyboard, or whatever...). Also, the Java program writing to the pane works fine:
msgField.setText("æøå test"); // this is displayed correctly
However, when I type from the keyboard into the Java program, all accented characters (including ä, ö, ñ, é, etc) are displayed as boxes. And if I echo the contents of the pane to terminal, I simply get question marks:
System.out.println(msgField.getText()); // this is displayed as "??? test"
(Allso the correctly displayed characters (via setText, as above) are echoed as question marks...)
Does anyone have any tips on how to fix this? I have tried installing MSTT core fonts (http://penguinfonts.com/howto/knoppix.php#3) (from Windows) on the Knoppix USB disk... Any help greatly appreciated!
Also, I have looked through the Forum, found a few related topics, (http://www.knoppix.net/forum/viewtopic.php?t=26905) but no solutions (http://www.knoppix.net/forum/viewtopic.php?t=4380) that worked for me. I tried editing the /etc/sysconfig/i18n file and exporting the $LANG variable, too. Btw, here's my i18n file:
LANG="no_NO@euro"
COUNTRY="no"
LANGUAGE="no"
CHARSET="iso8859-1"
XMODIFIERS=""
and the command env outputs (among lots of other stuff) this:
SHELL=/bin/bash
TERM=xterm
LC_ALL=no_NO@euro
JAVA_HOME=/home/knoppix/bin/jdk1.5.0_09
LANGUAGE=no
BASH_ENV=/home/knoppix/.bashrc
JDKHOME=/home/knoppix/bin/jdk1.5.0_09
- Joakim
Norway
The program is to be run on Knoppix, with the configurations (and home dir) stored on an USB disk. First off, in the terminal prompt, I am able to type accented characters, so it seems the System is configured correctly (under Keyboard, or whatever...). Also, the Java program writing to the pane works fine:
msgField.setText("æøå test"); // this is displayed correctly
However, when I type from the keyboard into the Java program, all accented characters (including ä, ö, ñ, é, etc) are displayed as boxes. And if I echo the contents of the pane to terminal, I simply get question marks:
System.out.println(msgField.getText()); // this is displayed as "??? test"
(Allso the correctly displayed characters (via setText, as above) are echoed as question marks...)
Does anyone have any tips on how to fix this? I have tried installing MSTT core fonts (http://penguinfonts.com/howto/knoppix.php#3) (from Windows) on the Knoppix USB disk... Any help greatly appreciated!
Also, I have looked through the Forum, found a few related topics, (http://www.knoppix.net/forum/viewtopic.php?t=26905) but no solutions (http://www.knoppix.net/forum/viewtopic.php?t=4380) that worked for me. I tried editing the /etc/sysconfig/i18n file and exporting the $LANG variable, too. Btw, here's my i18n file:
LANG="no_NO@euro"
COUNTRY="no"
LANGUAGE="no"
CHARSET="iso8859-1"
XMODIFIERS=""
and the command env outputs (among lots of other stuff) this:
SHELL=/bin/bash
TERM=xterm
LC_ALL=no_NO@euro
JAVA_HOME=/home/knoppix/bin/jdk1.5.0_09
LANGUAGE=no
BASH_ENV=/home/knoppix/.bashrc
JDKHOME=/home/knoppix/bin/jdk1.5.0_09
- Joakim
Norway