# Character Mapping Table
# DOS code page 437 <-> ISO Latin-1

# To use this file, you must first compile it with MKCHRTAB (also known
# as MKCHRTAB32 for Windows 95/NT users).
#
# To compile a game using this character set mapping, prepare the game's
# source code using DOS code page 437, then compile the game using this
# command:
#
#    tc -ctab 437la1.tcp mygame.t
#
# To play a game using ISO Latin 1 on DOS, make sure your DOS command
# prompt is set to code page 437, then play the game normally.  The TADS
# run-time should automatically load the compiled version of this mapping
# file.
#


# Internal Character Set Identifier - this is a string of no more than
# four characters that uniquely and universally identifies the character
# set.  For a given character set, this ID must be the same on every
# platform.  The reason the ID must be the same everywhere is that the
# run-time uses the ID, which the compiler stores in the .GAM file, to
# choose the character set mapping file when a player loads the game.
# In order to allow you to compile your game on one system, and have
# players run the game on different systems, every system must use the
# same character set identifier for the internal character set, so that
# every platform can choose the correct character set mapping to the
# native character set.
#
# IMPORTANT - to ensure that character set identifiers are universal
# and unique, character set identifiers MUST be registered.  Currently,
# Mike Roberts (mjr_@hotmail.com) maintains the list of registered
# character set identifiers; please contact him by email if you would
# like the current list or add a new character set to the list.
#
# You do NOT need to register *native* character sets.  The native
# character set used to compile a game is not stored with the game,
# because it is irrelevant once the game is compiled -- the game is
# entirely translated to the internal character set during compilation.
# Note, however, that the TADS run-time varies by operating system in
# how it determines the native character set, and how it chooses a
# character set mapping file based on the native character set.
#
# On DOS, the run-time chooses a native character set based on the active
# "code page"; DOS labels code pages with 3- or 4-digit numbers.  (For
# example, this file is for code page 437, the DOS US code page.)  The
# run-time generates the name of the character mapping table by appending
# the internal character set ID to the code page number, then adding the
# extension ".tcp" -- for example, the mapping file for native code page
# 437 to internal character set ISO Latin 1 is called "437LA1.TCP".
# This convention is system-specific; consult the documentation for your
# version of TADS for local conventions.
#
# Members of the ISO Latin-X series of character sets are all registered,
# and are assigned identifiers such of the form "LaX", where X is the
# numeric suffix to the ISO Latin name.  For example, ISO Latin-1 (ISO
# 8859-1) has identifier "La1", ISO Latin-2 has identifier "La2", and
# so on.
#
id = La1


# Full name of the internal character set - this name is stored in a
# game compiled with this internal character set, so that the run-time
# can display a sensible error message if a suitable mapping file is
# not available when a player loads the game.  The full name isn't used
# for choosing the mapping file, but is meant for the player to see.
#
# Each registered character set has an official full name, which should
# be used here to ensure that players encountering character mapping
# problems can more easily determine what file they need.  The ISO
# Latin series names should be of the form "ISO Latin-X (ISO 8859-Y)".
#
ldesc = ISO Latin-1 (ISO 8859-1)


# Extra System-specific information - this can be any string of
# characters; the meaning is system-dependent.  For DOS, this extra
# information is ignored, so we'll just leave it out entirely here.
# Other systems use it for varying purposes.  On Windows, for example,
# this string contains a code page number, which the TADS run-time
# will use as the system code page when this character set is selected
# by a game.
# EXTRA_SYSTEM_INFO = none

# ---------------------------------------------------------------------------
# The ASCII subset 1-127 is the same in both character sets and therefore
# doesn't need to be mapped

#
# The following characters have equivalent characters in both character
# sets, so we'll provide a reversible 1-to-1 mapping.

# DOS 437 <-> ISO Latin 1
128 <-> 199
129 <-> 252
130 <-> 233
131 <-> 226
132 <-> 228
133 <-> 224
134 <-> 229
135 <-> 231
136 <-> 234
137 <-> 235
138 <-> 232
139 <-> 239
140 <-> 238
141 <-> 236
142 <-> 196
143 <-> 197
144 <-> 201
145 <-> 230
146 <-> 198
147 <-> 244
148 <-> 246
149 <-> 242
150 <-> 251
151 <-> 249
152 <-> 255
153 <-> 214
154 <-> 220
155 <-> 162
156 <-> 163
157 <-> 165
160 <-> 225
161 <-> 237
162 <-> 243
163 <-> 250
164 <-> 241
165 <-> 209
166 <-> 170
167 <-> 186
168 <-> 191
170 <-> 172
171 <-> 189
172 <-> 188
173 <-> 161
174 <-> 171
175 <-> 187
179 <-> 166
196 <-> 151
230 <-> 181
241 <-> 177
246 <-> 247
248 <-> 176
249 <-> 183
253 <-> 178

#
# there are a few characters in the DOS character set that map to the same
# ISO Latin 1 character as some other DOS character; we'll cover those
# here.

250 -> 183

#
# these characters are mappings from ISO Latin 1 that are redundant --
# multiple characters in ISO Latin 1 map to the same character in DOS
# code page 437.  So, we only need to provide the mapping from ISO Latin 1.

# DOS code page 437 <- ISO Latin 1

196 <- 150


#
# The following characters from DOS code page 437 have no equivalents
# in ISO Latin-1.  We'll map them to character 129; this character
# isn't used in Latin-1, so we'll use it as our invalid character code.
# We'll map it back to character 250 in code page 437, which is a
# mid-dot character; this will serve as our "missing character" display
# indicator.

# DOS 437 -> ISO Latin 1 invalid (129) -> DOS 437 invalid (177)
127 -> 129 -> 250
158 -> 129
159 -> 129
169 -> 129
176 -> 129
177 -> 129
178 -> 129
180 -> 129
181 -> 129
182 -> 129
183 -> 129
184 -> 129
185 -> 129
186 -> 129
187 -> 129
188 -> 129
189 -> 129
190 -> 129
191 -> 129
192 -> 129
193 -> 129
194 -> 129
195 -> 129
197 -> 129
198 -> 129
199 -> 129
200 -> 129
201 -> 129
202 -> 129
203 -> 129
204 -> 129
205 -> 129
206 -> 129
207 -> 129
208 -> 129
209 -> 129
210 -> 129
211 -> 129
212 -> 129
213 -> 129
214 -> 129
215 -> 129
216 -> 129
217 -> 129
218 -> 129
219 -> 129
220 -> 129
221 -> 129
222 -> 129
223 -> 129
224 -> 129
225 -> 129
226 -> 129
227 -> 129
228 -> 129
229 -> 129
231 -> 129
232 -> 129
233 -> 129
234 -> 129
235 -> 129
236 -> 129
237 -> 129
238 -> 129
239 -> 129
240 -> 129
242 -> 129
243 -> 129
244 -> 129
245 -> 129
247 -> 129
251 -> 129
252 -> 129
254 -> 129
255 -> 129

#
# The following characters from ISO Latin 1 do not have exact equivalents
# in DOS code page 437, but have reasonable approximations.  For example,
# we'll map accented characters to the unaccented version when no
# accented version is available.
#

'\'' <- 130
'"' <- 132
'<' <- 139
'\'' <- 145
'\'' <- 146
'"' <- 147
'"' <- 148
'>' <- 155
'Y' <- 159
'\'' <- 180
',' <- 184
'A' <- 192
'A' <- 193
'A' <- 194
'A' <- 195
'E' <- 200
'E' <- 202
'E' <- 203
'I' <- 205
'I' <- 206
'I' <- 207
'O' <- 210
'O' <- 211
'O' <- 212
'O' <- 213
'x' <- 215
'O' <- 216
'U' <- 217
'U' <- 218
'U' <- 219
'Y' <- 221
225 <- 223
'a' <- 227
'o' <- 245
'o' <- 248
'y' <- 253


#
# The following characters from ISO Latin 1 do not appear in DOS code
# page 437.  Map these ISO Latin 1 characters to our "missing character"
# indicator (DOS code page character 250).

250 <- 128
250 <- 131
250 <- 133
250 <- 134
250 <- 135
250 <- 136
250 <- 137
250 <- 138
250 <- 140
250 <- 141
250 <- 142
250 <- 143
250 <- 144
250 <- 149
250 <- 152
250 <- 153
250 <- 154
250 <- 156
250 <- 157
250 <- 158
250 <- 160
250 <- 164
250 <- 167
250 <- 168
250 <- 169
250 <- 173
250 <- 174
250 <- 175
250 <- 179
250 <- 182
250 <- 185
250 <- 190
250 <- 204
250 <- 208
250 <- 222
250 <- 240
250 <- 254


#
# We can also specify entity mappings for this character set.
# The entity mappings provide the local character set expansions for
# the HTML named entities.
#
&scaron = 's'
&Scaron = 'S'
&sbquo = '\''
&bdquo = '"'
&dagger = 250
&Dagger = 250
&permil = 250
&lsaquo = '<'
&OElig =  250
&lsquo =  '\''
&rsquo =  '\''
&ldquo =  '"'
&rdquo =  '"'
&ndash = 0304
&mdash = '-' '-'
&trade =  '(' 't' 'm' ')'
&rsaquo = '>'
&oelig =  250
&Yuml =  'Y'
&iexcl =  0255
&cent =   0233
&pound =  0234
&curren = 250
&yen =    0235
&brvbar = 0263
&sect =   250
&uml =    250
&copy =   '(' 'c' ')'
&ordf =   0246
&laquo =  0256
&not =    0252
&shy =    ' '
&reg =    '(' 'R' ')'
&macr =   250
&deg =    0370
&plusmn = 0361
&sup2 =   0375
&sup3 =   250
&acute =  '\''
&micro =  0346
&para =   250
&middot = 0371
&cedil =  ','
&sup1 =   250
&ordm =   0247
&raquo =  0257
&frac14 = 0254
&frac12 = 0253
&frac34 = '3' '/' '4'
&iquest = 0250
&Agrave = 'A'
&Aacute = 'A'
&Acirc =  'A'
&Atilde = 'A'
&Auml =   0216
&Aring =  0217
&AElig =  0222
&Ccedil = 0200
&Egrave =  'E'
&Eacute = 0220
&Ecirc =  'E'
&Euml =  'E'
&Igrave =  'I'
&Iacute =  'I'
&Icirc =  'I'
&Iuml =  'I'
&ETH =   250
&Ntilde = 0245
&Ograve =  'O'
&Oacute =  'O'
&Ocirc =  'O'
&Otilde =  'O'
&Ouml = 0231
&times =  'x'
&Oslash =  'O'
&Ugrave =  'U'
&Uacute =  'U'
&Ucirc =  'U'
&Uuml = 0232
&Yacute =  'Y'
&THORN =   250
&szlig = 0341
&agrave = 0205
&aacute = 0240
&acirc = 0203
&atilde =  'a'
&auml = 0204
&aring = 0206
&aelig = 0221
&ccedil = 0207
&egrave = 0212
&eacute = 0202
&ecirc = 0210
&euml = 0211
&igrave = 0215
&iacute = 0241
&icirc = 0214
&iuml = 0213
&eth =   250
&ntilde = 0244
&ograve = 0225
&oacute = 0242
&ocirc = 0223
&otilde =  'o'
&ouml = 0224
&divide = 0366
&oslash =  'o'
&ugrave = 0227
&uacute = 0243
&ucirc = 0226
&uuml = 0201
&yacute =  'y'
&thorn =   250
&yuml = 0230
&circ = '^'
&tilde = '~'

# code page 437 has a bunch of the math symbols and Greek letters as well
&fnof = 159
&alpha = 224
&Gamma = 226
&pi = 227
&Sigma = 228
&sigma = 229
&tau = 231
&Phi = 232
&Theta = 233
&Omega = 234
&delta = 235
&infin = 236
&phi = 237
&epsilon = 238
&cap = 239
&equiv = 240
&ge = 242
&le = 243
&asymp = 247
&radic = 251

# several of the capital Greek letters look a lot like Roman letters
&Alpha = 'A'
&Beta = 'B'
&Zeta = 'Z'
&Eta = 'H'
&Iota = 'I'
&Kappa = 'K'
&Mu = 'M'
&Nu = 'N'
&Omicron = 'O'
&Rho = 'P'
&Tau = 'T'
&Upsilon = 'Y'
&Chi = 'X'

# provide approximations for the Latin-2 entities
&Aogon = 'A'
&Lstrok = 'L'
&Lcaron = 'L'
&Sacute = 'S'
&Scedil = 'S'
&Tcaron = 'T'
&Zacute = 'Z'
&Zcaron = 'Z'
&Zdot = 'Z'
&aogon = 'a'
&ogon = 'o'
&lstrok = 'l'
&lcaron = 'l'
&sacute = 's'
&scedil = 's'
&tcaron = 't'
&zacute = 'z'
&dblac = '"'
&zcaron = 'z'
&zdot = 'z'
&Racute = 'R'
&Abreve = 'A'
&Lacute = 'L'
&Cacute = 'C'
&Ccaron = 'C'
&Eogon = 'E'
&Ecaron = 'E'
&Dcaron = 'D'
&Dstrok = 'D'
&Nacute = 'N'
&Ncaron = 'N'
&Odblac = 'O'
&Rcaron = 'R'
&Uring = 'U'
&Udblac = 'U'
&Tcedil = 'T'
&racute = 'r'
&abreve = 'a'
&lacute = 'l'
&cacute = 'c'
&ccaron = 'c'
&eogon = 'e'
&ecaron = 'e'
&dcaron = 'd'
&dstrok = 'd'
&nacute = 'n'
&ncaron = 'n'
&odblac = 'o'
&rcaron = 'r'
&uring = 'u'
&udblac = 'u'
&tcedil = 't'
