MBCS to UTF-8

K

kartikeya.k

I have an client application (written in C++) using gSOAP to send SOAP
message to java web service, for one of the input parameter, C++
application is sending Japanese text as MBCS format to gSAOP, In the
sever side, Java Web Services is not able to convert from MBCS to
UTF-8.

I tried, following code to convert japanese text form SOAP message to
UTF-8.

public static String convertToUTF8(String str) {
StringBuffer sBuf = new StringBuffer();
try {
InputStream in = new StringBufferInputStream(str);
BufferedReader br = new BufferedReader(new InputStreamReader(in,
"UTF-8"));
while ((str = br.readLine()) != null) {
if (sBuf.length() > 0) sBuf.append(Endl());
sBuf.append(str);
}
br.close();
str = sBuf.toString();
} catch (UnsupportedEncodingException e) {
} catch (Exception e) {
}

return str;

}



TCPMON is not showing Japanese characters on the server side. It shows
some garbled characters.

Please help
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,730
Latest member
AudryNolan

Latest Threads

Top