Processing Chinese GB 18030 data
GB 18030 is a national-character standard specified by the government of the People's Republic of China.
About this task
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.
Enterprise COBOL does not have explicit support for GB 18030, but does support the processing of GB 18030 characters in several ways. You can:
- Use DBCS data items to process GB 18030 characters that are represented in CCSID 1388.
- Use national data items to define and process GB 18030 characters that are represented in UTF-16, CCSID 01200.
- Process data in any code page (including CCSID 1388 or 1392) by converting the data to UTF-16, processing the UTF-16 data, and then converting the data back to the original code-page representation.
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 1388 or 1392 as the second argument of each
function.
The following example illustrates these conversions:
Converting to or from national (Unicode) representation
Coding for use of DBCS support