Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Image description: converting to GB 18030

This image shows code for converting Chinese GB 18030 characters from ASCII code page 1386 to Unicode, and then from Unicode back to ASCII code page 1386. The following code is the same except that the VALUE clause in the image has seven Chinese characters where this code has 'Chinese text'.

 01 Chinese-ASCII pic X(16) value 'Chinese text'.
 01 Chinese-GB18030-String pic X(16).
 01 UnicodeString pic N(14).
 . . .
     Move function National-of(Chinese-ASCII, 1386) to UnicodeString
*  Process data in Unicode
     Move function Display-of(UnicodeString, 1386) to Chinese-GB18030-String

End of image description.


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)