Skip to main content

Three-argument Form: Encoding Translation

Three-argument Form: Encoding Translation

$ZCONVERT(string, mode, trantable) performs either an input encoding translation or an output encoding translation on string. In the three-argument form, the mode values you can use are either "I" or "O". You must define the mode value. For “I” translations, the string may be a hexadecimal string, such as %4B (the letter “K”); hexadecimal strings are not case-sensitive.

You can use ZZDUMP to display the hexadecimal encoding for a string of characters. You can use $CHAR to specify a character (or string of characters) by its decimal (base 10) encoding; you can use $ZHEX to convert a hexadecimal number to a decimal number, or a decimal number to a hexadecimal number. If the translated value is a non-printing character, InterSystems IRIS displays it as a null string. If the target device cannot represent a translated character, InterSystems IRIS substitutes a question mark (?) character for the non-displayable character.

The trantable value can be a numeric character or a string that specifies the translation table or translation handle to use. The trantable value can be:

  • An integer value specifying a process I/O translation object. Available values are 0 through 3 (0 represents the current process I/O translation object).

  • An uppercase string value identifying an I/O translation table. See Translation Tables for a list and details.

  • A string value specifying an I/O translation table defined by an NLS locale. For example, Latin2 or CP1252. See Translation Tables for a list and details.

  • A string value specifying a user-defined I/O translation table. A named table can be defined in a locale and points to one or two translation tables. Use a named table to define a specific system-to/from-device encoding.

  • An empty string ("") specifying the use of the default process I/O translation table. (For equivalent functionality, see the $$GetPDefIO^%NLS() function of the %NLS utility.)

FeedbackOpens in a new tab