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.
7
Redistribution and use in source and binary forms, with or without
8
modification, are permitted provided that the following conditions
10
1. Redistributions of source code must retain the above copyright
11
notice, this list of conditions and the following disclaimer.
12
2. Redistributions in binary form must reproduce the above copyright
13
notice, this list of conditions and the following disclaimer in the
14
documentation and/or other materials provided with the distribution.
16
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28
Major Release ID: X-TrueType Server Version 1.3 [Aoi MATSUBARA Release 3]
33
#include "xttversion.h"
35
static char const * const releaseID =
38
#include "xttcommon.h"
41
#include "xttcconvP.h"
52
static CharSetRelation const charSetRelations[] = {
53
{ "koi8", NULL, "1", KOI8_R, { 0x20, 0xff, 0, 0, 0x20 } },
54
{ "koi8", NULL, "r", KOI8_R, { 0x20, 0xff, 0, 0, 0x20 } },
55
{ "koi8", NULL, "u", KOI8_U, { 0x20, 0xff, 0, 0, 0x20 } },
56
{ "koi8", NULL, "ru", KOI8_RU, { 0x20, 0xff, 0, 0, 0x20 } },
57
{ "koi8", NULL, "uni", KOI8_UNI, { 0x20, 0xff, 0, 0, 0x20 } },
58
{ NULL, NULL, NULL, 0, { 0, 0, 0, 0, 0 } }
62
CODECONV_TEMPLATE(cc_koi8_r_to_ucs2);
63
CODECONV_TEMPLATE(cc_koi8_u_to_ucs2);
64
CODECONV_TEMPLATE(cc_koi8_ru_to_ucs2);
65
CODECONV_TEMPLATE(cc_koi8_uni_to_ucs2);
66
static MapIDRelation const mapIDRelations[] = {
67
{ KOI8_R, EPlfmISO, EEncISO10646,
68
cc_koi8_r_to_ucs2, NULL },
69
{ KOI8_R, EPlfmUnicode, EEncAny,
70
cc_koi8_r_to_ucs2, NULL },
71
{ KOI8_R, EPlfmMS, EEncMSUnicode,
72
cc_koi8_r_to_ucs2, NULL },
73
{ KOI8_U, EPlfmISO, EEncISO10646,
74
cc_koi8_u_to_ucs2, NULL },
75
{ KOI8_U, EPlfmUnicode, EEncAny,
76
cc_koi8_u_to_ucs2, NULL },
77
{ KOI8_U, EPlfmMS, EEncMSUnicode,
78
cc_koi8_u_to_ucs2, NULL },
79
{ KOI8_RU, EPlfmISO, EEncISO10646,
80
cc_koi8_ru_to_ucs2, NULL },
81
{ KOI8_RU, EPlfmUnicode, EEncAny,
82
cc_koi8_ru_to_ucs2, NULL },
83
{ KOI8_RU, EPlfmMS, EEncMSUnicode,
84
cc_koi8_ru_to_ucs2, NULL },
85
{ KOI8_UNI, EPlfmISO, EEncISO10646,
86
cc_koi8_uni_to_ucs2, NULL },
87
{ KOI8_UNI, EPlfmUnicode, EEncAny,
88
cc_koi8_uni_to_ucs2, NULL },
89
{ KOI8_UNI, EPlfmMS, EEncMSUnicode,
90
cc_koi8_uni_to_ucs2, NULL },
91
{ -1, 0, 0, NULL, NULL }
94
STD_ENTRYFUNC_TEMPLATE(KOI8_entrypoint)
100
Copyright (c) 1997 by Mark Leisher
101
Copyright (c) 1998 by Juliusz Chroboczek
106
cc_koi8_u_to_ucs2(ft_char_code_t codeSrc)
111
case 0xA4: codeDst = 0x0454; break;
112
case 0xA6: codeDst = 0x0456; break;
113
case 0xA7: codeDst = 0x0457; break;
114
case 0xAD: codeDst = 0x0491; break;
115
case 0xB4: codeDst = 0x0403; break;
116
case 0xB6: codeDst = 0x0406; break;
117
case 0xB7: codeDst = 0x0407; break;
118
case 0xBD: codeDst = 0x0490; break;
119
default: codeDst = cc_koi8_r_to_ucs2(codeSrc);
126
cc_koi8_ru_to_ucs2(ft_char_code_t codeSrc)
131
case 0x93: codeDst = 0x201C; break;
132
case 0x96: codeDst = 0x201D; break;
133
case 0x97: codeDst = 0x2014; break;
134
case 0x98: codeDst = 0x2116; break;
135
case 0x99: codeDst = 0x2122; break;
136
case 0x9B: codeDst = 0x00BB; break;
137
case 0x9C: codeDst = 0x00AE; break;
138
case 0x9D: codeDst = 0x00AB; break;
139
case 0x9F: codeDst = 0x00A4; break;
140
case 0xA4: codeDst = 0x0454; break;
141
case 0xA6: codeDst = 0x0456; break;
142
case 0xA7: codeDst = 0x0457; break;
143
case 0xAD: codeDst = 0x0491; break;
144
case 0xAE: codeDst = 0x045E; break;
145
case 0xB4: codeDst = 0x0404; break;
146
case 0xB6: codeDst = 0x0406; break;
147
case 0xB7: codeDst = 0x0407; break;
148
case 0xBD: codeDst = 0x0490; break;
149
case 0xBE: codeDst = 0x040E; break;
150
default: codeDst = cc_koi8_r_to_ucs2(codeSrc);