Question: I want to get the
java.lang.String to read a stream ofChinese
characters. But I am getting only rubbish characters.
How can I make my program language independent?
need to have 3 elements: 1. A font.properties file 2. Fonts 3. Swing/AWT components
Add your new font (Chinese) to font.properties file.
Remember that AWT components are limited to displaying charactersdefined in the host's default code page. For example on an EnglishOS, it is code page 1252.
Until you change a default code page you can not display textproperly in a Frame title, a TextArea, or a TextField. If youchange it the rest of the system will not be possible to use The solution is to use only Swing components.
Java 2 allows you to load any font and you will not be limited byfonts that are defined in font.properties file.