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
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