Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing a XML file with Chinese Character in AS/400

 
Ed Tang
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Pie
Posts: 20776
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic