GET_CP_CONVERT_TABLE
This verb provides a utility service that builds a conversion table from one code page to another. This verb returns a 256-byte conversion table that applications can use to perform table lookups on characters to convert character strings.
A program might need to perform data conversion when it communicates with a node that expects data encoded in a different code page.
struct get_cp_convert_table
{
unsigned short opcode; /* Verb identifying operation code. */
unsigned char opext; /* Reserved. */
unsigned char reserv2; /* Reserved. */
unsigned short primary_rc; /* Primary return code from verb. */
unsigned long secondary_rc; /* Secondary (qualifying) return code. */
unsigned short source_cp; /* Source code page for conversion table */
unsigned short target_cp; /* Target code page for conversion table */
unsigned char *conv_tbl_addr; /* Address to put conversion table at */
unsigned char char_not_fnd; /* Character not found option: either */
/* substitute character or round trip */
unsigned char substitute_char; /* Substitute character to use. */
} GET_CP_CONVERT_TABLE;
- source_cp
- The code page number from which the replacement characters are drawn.
The number for the code page can be one of the following numbers:
- ASCII code pages (in decimal)
- 437 US IBM® PC
- 737 Greece
- 813 Greece
- 819 ANSI Standard
- 850 Multilingual
- 852 Czechoslovakia/Hungary/Poland/Yugoslavia
- 855 Cyrillic
- 857 Turkey
- 858 Multilingual
- 860 Portuguese
- 861 Iceland
- 862 Hebrew
- 863 Canada-French
- 864 Arabic
- 865 Nordic
- 866 Cyrillic
- 874 Thai
- 912 Latin 2
- 915 Cyrillic
- 916 Hebrew
- 920 Turkey
- 921 Latvia, Lithuania
- 922 Estonia
- 923 ANSI Standard
- 1008 Arabic
- 1089 Arabic
- 1124 Ukraine
- 1125 Ukraine
- 1127 Arabic/French
- 1129 Vietnamese
- 1131 Belarus
- 1133 Lao
- 1250 Latin 2
- 1251 Cyrillic
- 1252 Latin 1
- 1253 Greece
- 1254 Turkey
- 1255 Hebrew
- 1256 Arabic
- 1257 Baltic (Latvia, Lithuania, Estonia)
- 1258 Vietnamese
- EBCDIC code pages (in decimal)
- 037 United States/Canada-French/Netherlands/Portugal/Brazil
- 273 Germany/Austria
- 275 Brazil
- 277 Denmark/Norway
- 278 Finland/Sweden
- 280 Italy
- 284 Latin America/Spain
- 285 United Kingdom
- 297 France
- 420 Arabic
- 424 Hebrew
- 500 Belgium/Switzerland-French/Switzerland-German
- 803 Hebrew
- 870 Czechoslovakia/Hungary/Poland/Yugoslavia
- 871 Iceland
- 875 Greece
- 924 Latin 1
- 1025 Cyrillic
- 1026 Turkey
- 1047 Latin 1
- 1112 Latvia, Lithuania
- 1122 Estonia
- 1123 Ukraine
- 1130 Vietnamese
- 1132 Lao
- 1140 United States/Canada/Netherlands/Portugal/Brazil/Australia/New Zealand
- 1141 Germany/Austria
- 1142 Denmark/Norway
- 1143 Finland/Sweden
- 1144 Italy
- 1145 Latin America/Spain
- 1146 United Kingdom
- 1147 France
- 1148 Belgium/Switzerland
- 1149 Iceland
- 1153 Bosnia/Herzegovina (Latin), Croatia, Czech Republic, Hungary, Poland, Romania (Moldava), Slovakia, Slovenia
- 1154 Cyrillic—Bulgaria, Belarus, FYR Macedonia, Serbia, Russia
- 1155 Turkey
- 1156 Latvia, Lithuania
- 1157 Estonia
- 1158 Ukraine
- 1160 Thailand
- 1164 Vietnam
- User defined code pages
- 65280 through 65534
- When using user-defined code pages, first define the registry entry with
the user-defined path to the CPT files as follows for Personal Communications:
For Communications Server, define the registry entry with the user-defined path to the CPT files as follows:HKEY_LOCAL_MACHINE/SOFTWARE/IBM/Personal Communications /CurrentVersion/COMCPTHKEY_LOCAL_MACHINE/SOFTWARE/IBM/Communications Server/CurrentVersion/COMCPT
Note:Only identical characters in the source and target code pages are guaranteed to be converted into each other. Character pairs designated in the standards that merely resemble each other are not usually converted into each other. - ASCII code pages (in decimal)
- target_cp
- The code page number for the target strings to be converted. The number can be any of those shown for source_code_page.
- conv_tbl_addr
- The address of the buffer that is to receive the 256-byte conversion table. This buffer must be in a read/write segment.
- char_not_fnd
- The action to be taken if a character in the source code page does not
exist in the target code page. Specify one of the following values:
- SV_ROUND_TRIP
- This option causes the values to be stored in the conversion table so that if a conversion table is generated by reversing the source and target code pages, the result of a conversion from source to target code page and back again results in the original character. You must select the ROUND_TRIP option for both table generations for this option to run.
- SV_SUBSTITUTE
- Store the character specified in the parameter substitute_character in the conversion table.
- substitute_char
- The byte stored in the conversion table if a character in the source code page does not exist on the target code page and if the character_not_found parameter is set to SV_SUBSTITUTE.
The OK return code indicates that the GET_CP_CONVERT_TABLE verb ran successfully.
The following parameter is returned when the return code is OK:
- convert_table
- The conversion table was built at the address specified by CONV_table_addr.
- primary_rc
- SV_PARAMETER_CHECK
- secondary_rc
- SV_INVALID_CHAR_NOT_FOUND
SV_INVALID_DATA_SEGMENT
SV_INVALID_SOURCE_CODE_PAGE
SV_INVALID_TARGET_CODE_PAGE