1
/* ===EmacsMode: -*- Mode: C; tab-width:4; c-basic-offset: 4; -*- === */
3
Copyright (c) 1998 Takuya SHIOZAKI, All Rights reserved.
4
Copyright (c) 1998 X-TrueType Server Project, All rights reserved.
5
Copyright (c) 1998,1999 Pablo Saratxaga <srtxg@chanae.alphanet.ch>
8
Redistribution and use in source and binary forms, with or without
9
modification, are permitted provided that the following conditions
11
1. Redistributions of source code must retain the above copyright
12
notice, this list of conditions and the following disclaimer.
13
2. Redistributions in binary form must reproduce the above copyright
14
notice, this list of conditions and the following disclaimer in the
15
documentation and/or other materials provided with the distribution.
17
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29
Major Release ID: X-TrueType Server Version 1.3 [Aoi MATSUBARA Release 3]
33
Table build by looking into the unicode chart, and various DOS
34
and Windows fonts, DOS manuals and GNU libc internationalization
37
support for those encodings may seem useless for X11, but doesmu users
38
can appreciate it, as well as users of any kind of DOS emulator.
39
Also several True Type fonts made primarly for Windows are completly
40
broken, that is the unicode codes they told are wrong, they claim to
41
be cp1252 while they are not. So the alias -misc-fontspecific can
42
be helpfull to use TTF fonts wrongly encoded (that is the case of
43
all the vietnamese fonts I've seen so far, they have to be called
44
whith -misc-fontspecific instead of -viscii1.1-1 *sigh*)
48
#include "xttversion.h"
50
static char const * const releaseID =
53
#include "xttcommon.h"
56
#include "xttcconvP.h"
66
static CharSetRelation const charSetRelations[] = {
67
{ "ibm", NULL, "cp437", CP437, { 0x00, 0xff, 0, 0, 0x20 } },
68
{ "ibm", NULL, "cp850", CP850, { 0x00, 0xff, 0, 0, 0x20 } },
69
{ "microsoft", NULL, "cp1252", CP1252, { 0x00, 0xff, 0, 0, 0x20 } },
70
{ "ansi", NULL, "0", CP1252, { 0x00, 0xff, 0, 0, 0x20 } },
71
{ "microsoft", NULL, "win3.1", CP1252, { 0x00, 0xff, 0, 0, 0x20 } },
72
{ "microsoft", NULL, "fontspecific", CP1252, { 0x00, 0xff, 0, 0, 0x20 } },
73
{ "misc", NULL, "fontspecific", CP1252, { 0x00, 0xff, 0, 0, 0x20 } },
74
{ NULL, NULL, NULL, 0, { 0, 0, 0, 0, 0 } }
78
CODECONV_TEMPLATE(cc_cp437_to_ucs2);
79
CODECONV_TEMPLATE(cc_cp850_to_ucs2);
80
CODECONV_TEMPLATE(cc_cp1252_to_ucs2);
81
static MapIDRelation const mapIDRelations[] = {
82
{ CP437, EPlfmISO, EEncISO10646, cc_cp437_to_ucs2, NULL },
83
{ CP437, EPlfmUnicode, EEncAny, cc_cp437_to_ucs2, NULL },
84
{ CP437, EPlfmMS, EEncMSUnicode, cc_cp437_to_ucs2, NULL },
85
{ CP850, EPlfmISO, EEncISO10646, cc_cp850_to_ucs2, NULL },
86
{ CP850, EPlfmUnicode, EEncAny, cc_cp850_to_ucs2, NULL },
87
{ CP850, EPlfmMS, EEncMSUnicode, cc_cp850_to_ucs2, NULL },
88
{ CP1252, EPlfmISO, EEncISO10646, cc_cp1252_to_ucs2, NULL },
89
{ CP1252, EPlfmUnicode, EEncAny, cc_cp1252_to_ucs2, NULL },
90
{ CP1252, EPlfmMS, EEncMSUnicode, cc_cp1252_to_ucs2, NULL },
91
{ -1, 0, 0, NULL, NULL }
94
STD_ENTRYFUNC_TEMPLATE(DOSENCODING_entrypoint)