Re: Unicode - UGLY GUI



Thomas Kellerer wrote:
On 28.06.2005 12:41 ravi.k.sinha@xxxxxxxxx wrote:


Hi,

I m working on a GUI app. which uses Indian langage input methods, in
short it makes use of Unicode.

I run the app with the following command line

java -Dfile.encoding="UTF-8" package.myClass



AFAIK file.encoding does not have any impact on the Swing classes.
This is (only?) used by Reader and Writer implementations as the default encoding.

Thomas
Yes, the constructors
  InputStreamReader(InputStream)
  OutputStreamReader(OutputStream)
  FileReader(...)
  FileWriter(...)
  -and may be some more?-
do so.

But furthermore the constructors
  String(byte[])
  String(byte[], int, int)
and the methods of String class
  byte[] getBytes()
  void getBytes(int, byte[], int, int)
depend on the default encoding, too.

I recommend to avoid these constructors/methods altogether.
Most of them have sister constructors/methods which take an encoding name as an additional String argument.


--
"Thomas:Fritsch$ops:de".replace(':','.').replace('$','@')

.