String encoding problem

I am not sure whether its a right place or not, but my issue might be

related to java.

I have a server running on the solaris machine, and a client on windows

machine. The client and server communicates via CORBA.

I have a user exception defined in my IDL file and my error messages

are in chinese characters. Since i had problem displaying the error

message properly on the client side, i decided to encode the messages.

Actaully, the messages in IDL is defined as String.

Here's a snippet of the code i tried to encode the strings,

//CORBA USER EXCEPTION defined in IDL

Exception srvError{

string errorCode;

string errorMsg;

}

//on server side //try catch not included below

errorCode =new String(errorCode.getBytes(encode),encode);//encode is the encoding used to encode the string. ex.: encode=Shift_JIS

errorMsg =new String(errorMsg.getBytes(encode),encode);

thrownew srvError(errorCode,errorMsg);

//on client side//e is srvError in the catch

System.out.println(e.errorCode);

System.out.println(e.errorMsg);

However, my error messages are still crooked and not displayed properly. If other than chinese characters(if in english) it shows well.

I know its encoding problem, but i do not know how it works in CORBA.

Anybody has any comments or suggestions to solve the above problem.

Thanx in advance.

[1768 byte] By [lupansanseia] at [2007-10-3 3:00:45]
# 1

What do you mean the error messages are still crooked ?

Are they the correct characters and it's just a cosmetic issue with the fonts ?

How are you displaying the characters ?

In an applet, web page, application etc ?

Have you tried saving the error message received to a text file or the like, to see whether it's being received correctly ? In which case it's a rendering problem?

On older JRE's you had to pick between a US Version and an International version of the JRE.I'm not sure if that's still the case. So you may be trying to interpret Japanese characters on your corba client, which is using a US English only VM.

regards,

Owen

omcgoverna at 2007-7-14 20:50:22 > top of Java-index,Java Essentials,Java Programming...