Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1064

Unable to convert bytes from charset 65535 in to Japanese (5035)

$
0
0

I have a character set conversion issue:

I am updating Japanese Kanji characters in DB2 in iSeries system with the following conversion method:

AS400 sys = new AS400("<host>","username","password");CharConverter charConv = new CharConverter(5035, sys);byte[] b = charConv.stringToByteArray(5035, sys, "試験");AS400Text textConverter = new AS400Text(b.length, 65535,sys);

While retrieving, I use the following code to convert & display:

CharConverter charConv = new CharConverter(5035, sys);byte[] bytes = charConv.stringToByteArray(5035, sys, dbRemarks);String s = new String(bytes);System.out.println("Remarks after conversion to AS400Text :"+s);

But, the system is displaying garbled characters while displaying. Can anybody help me to decode Japanese characters from binary storage?


Viewing all articles
Browse latest Browse all 1064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>