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


Processing Chinese GB 18030 data

GB 18030 is a national-character standard specified by the government of the People's Republic of China.

GB 18030 characters can be encoded in either UTF-16 or in code page CCSID 1392. Code page 1392 is an ASCII multibyte code page that uses 1, 2, or 4 bytes per character. A subset of the GB 18030 characters can be encoded in the Chinese ASCII code page, CCSID 1386, or in the Chinese EBCDIC code page, CCSID 1388.

COBOL for Windows does not have explicit support for GB 18030, but does support the processing of GB 18030 characters in several ways. You can:

When you need to process Chinese GB 18030 data that requires conversion, first convert the input data to UTF-16 in a national data item. After you process the national data item, convert it back to Chinese GB 18030 for output. For the conversions, use the intrinsic functions NATIONAL-OF and DISPLAY-OF, respectively, and specify code page 1386 as the second argument of each function.

The following example illustrates these conversions:

This image shows sample code for converting between Chinese GB 18030 data and Unicode.

Link to detail.

related tasks
Converting to or from national (Unicode) representation
Coding for use of DBCS support

related references
Storage of national data


Terms of use | Feedback

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