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


Processing UTF-8 data

When you need to process UTF-8 data, first convert the data to UTF-16 in a national data item. After processing the national data, convert it back to UTF-8 for output. For the conversions, use the intrinsic functions NATIONAL-OF and DISPLAY-OF, respectively. Use code page 1208 for UTF-8 data.

You need to do two steps to convert ASCII or EBCDIC data to UTF-8:

  1. Use the function NATIONAL-OF to convert the ASCII or EBCDIC string to a national (UTF-16) string.
  2. Use the function DISPLAY-OF to convert the national string to UTF-8.

The following example converts Greek EBCDIC data to UTF-8:

This image shows sample code for converting Greek EBCDIC data to UTF-8.

Link to detail.

related tasks
Converting to or from national (Unicode) representation


Terms of use | Feedback

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