aspose file tools*
The moose likes XML and Related Technologies and the fly likes Parsing a XML file with Chinese Character in AS/400 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Parsing a XML file with Chinese Character in AS/400" Watch "Parsing a XML file with Chinese Character in AS/400" New topic
Author

Parsing a XML file with Chinese Character in AS/400

Ed Tang
Greenhorn

Joined: Aug 04, 2010
Posts: 3
I am working on a project which require to parse a XML file (in UTF-8 encoding) and put the value into a AS/400 physical file by using JAVA. However, one of the tags in XML may contain both Traditional Chinese and Simplified Chinese characters.
The field in the physical file has already defined as DBCS (Open-type).
Now, my problem is I could only select ONE CCSID every time when I convert the byte stream back into string (for EBCDIC) in JAVA (please correct me if my understanding is wrong), for example, I am now using valueString.getBytes("CP937"). However, it seems that "CP937" does not support Simplified Chinese and if I change it to "CP935", the results is Traditional Chinese cannot be supported this time.

Could anyone advise how can I support both Traditional Chinese and Simplified Chinese? Thanks so much!
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18986
    
    8

Your question is "What CCSID should I choose on the i to support all varieties of Chinese characters", isn't it? So posting with that title isn't going to attract the right set of answerers.

However this article: V5R3 Advances DB2 UDB for iSeries suggests you should just use UTF-8 or UTF-16, in the form of CCSID 1208 or 1200.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing a XML file with Chinese Character in AS/400