Try OpenEdge Now
skip to main content
Internationalizing Applications
Character Processing Table Formats : Code-page conversion table
 

Code-page conversion table

The following figure shows the format of the code-page conversion table.
# Optional comments starting with the pound sign
CONVERT
SOURCE-NAME source-codepage
TARGET-NAME target-codepage
TYPE "1"
/*000-015*/ 000 001 002 003 055 045 046 047 022 005 037 011 012 013 014 015
/*016-031*/ 016 017 018 019 060 061 050 038 024 025 028 039 063 029 030 031
/*032-047*/ 064 090 127 123 091 108 080 125 077 093 092 078 107 096 075 097
/*048-063*/ 240 241 242 243 244 245 246 247 248 249 122 094 076 126 110 111
/*064-079*/ 124 193 194 195 196 197 198 199 200 201 209 210 211 212 213 214
/*080-095*/ 215 216 217 226 227 228 229 230 231 232 233 186 224 187 176 109
/*096-111*/ 121 129 130 131 132 133 134 135 136 137 145 146 147 148 149 150
/*112-127*/ 151 152 153 162 163 164 165 166 167 168 169 192 079 208 161 255
/*128-143*/ 104 220 081 066 067 068 071 072 082 083 084 087 086 088 099 103
/*144-159*/ 113 156 158 203 204 205 219 221 223 236 252 112 177 128 191 007
/*160-175*/ 069 085 206 222 073 105 154 155 171 175 095 184 183 170 138 139
/*176-191*/ 043 044 009 033 040 101 098 100 180 056 049 052 051 074 178 036
/*192-207*/ 034 023 041 006 032 042 070 102 026 053 008 057 054 048 058 159
/*208-223*/ 140 172 114 115 116 010 117 118 119 035 021 020 004 106 120 059
/*224-239*/ 238 089 235 237 207 239 160 142 174 254 251 253 141 173 188 190
/*240-255*/ 202 143 027 185 182 181 225 157 144 189 179 218 250 234 062 065
ENDTABLE
ENDCONVERT
The CONVERT keyword signals the beginning of a code-page conversion table entry. The NOINVERSE option of CONVERT tells OpenEdge not to create the table for the inverse conversion. If NOINVERSE does not appear, OpenEdge automatically creates the table for the inverse conversion. NOINVERSE is useful for one-way conversions such as character sets for terminals and printers. The SOURCE-NAME keyword precedes the name of the source code page. The TARGET-NAME keyword specifies the name of the target code page. The TYPE statement specifies a conversion algorithm. For a conversion between two single-byte code pages, set TYPE to 1.
To build a table to convert between two single-byte code pages, provide 256 values in 16 rows of 16 values. Be sure to format the rows of data exactly as shown in the figure.
The ENDTABLE keyword signals the end of the code-page conversion table. The ENDCONVERT keyword signals the end of the table entry.
To convert a character from one code page to another, OpenEdge looks in the code-page conversion table for the cell corresponding to the character's numeric value in the source code page. The cell contains the numeric value of the character in the target code page.
For example, consider converting the character "ä" from ISO8859-1 to IBM850. In ISO8859-1, "ä" has the value 228. The following example shows part of the ISO 8859-1 to IBM850 conversion table. To perform the conversion, OpenEdge looks in the table for cell 228 and finds the value 132. This value represents the numeric value of "ä" in IBM850:
#CONVMAP.dat Version 1.01
# This contains the data needed to convert from
# iso8859-1 to ibm code page 850
CONVERT
SOURCE-NAME "iso8859-1"
TARGET-NAME "ibm850"
TYPE 1
/*000-015*/ 000 001 002 003 004 005 006 007 008 009 010 011 012 013 014 015
/*016-031*/ 016 017 018 019 020 021 022 023 024 025 026 027 028 029 030 031
.
.
.
/*224-239*/ 133 160 131 198 132 134 145 135 138 130 136 137 141 161 140 139
/*240-255*/ 208 164 149 162 147 228 148 246 155 151 163 150 129 236 231 152
ENDTABLE
ENDCONVERT
* Convmap changes