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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top