UTF-8/Unicode and DBCS Support

Unicode Translation

 

Translating To/From Unicode

The TRANSLATE directive has been extended to convert the extended data between DBCS and Unicode. The new format for the TRANSLATE directive is:

TRANSLATE FROM <inputstr> [, TBL=nn ] TO <strvar$> [, TBL=nn ]

This directive can be used to translate data from DBCS to Unicode, Unicode to DBCS, or two different DBCS forms (different codepages). It will take the string provided in <inputstr> and convert it into <strvar$>. Various options exist:

If desired, you can specify TBL=* to indicate that you want to use the current default codepage.

Examples:

 

TRANSLATE FROM USER_INPUT$ TO DB_DATA$

Convert USER_INPUT$ from DBCS to Unicode into DB_DATA$

 

TRANSLATE FROM DB_DATA$ TO USER_OUTPUT$,TBL=*

Convert DB_DATA$ from Unicode to DBCS into USER_OUTPUT$ conversion based on current character set chosen by the user

Note:
Presently, the extended character support is limited to the Windows version of PxPlus or when using WindX in any supported server configuration. JavX does not support the use of the Extended Character set.

The TRANSLATE directive and TCB values are only available on a Windows system.