Debian Codegraph @

src/ansellat1.l

raw
1 /*
2 * Copyright (c) 1998, Wolfram Schneider <[email protected]>
3 * Konrad Zuse Zentrum für Informationstechnik Berlin.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 *
28 * 8-Bit ANSEL to ISO8859-1 conversion. This file support only a subset
29 * of Z39.47-1993 (ANSEL). It is incomplete due the lack of free
30 * available documentation ;-(
31 *
32 * http://www.niso.org/pccodes.htm
33 * Z39.47-1993 Extended Latin Alphabet Coded Character Set for
34 * Bibliographic Use (ANSEL)
35 *
36 * Character sets are a basic building block of automated information
37 * systems. Z39.47 provides a table of coded values for the
38 * representation of characters of the extended Latin alphabet in
39 * machine-readable form for thirty-five languages written in the Latin
40 * alphabet and for fifty-one romanized languages.
41 *
42 * 27 pp. ISBN: 1-880124-02-5 Price: $40.00
43 *
44 *
45 * http://wwnet.com/~krugman1/gentext/gedstand.txt
46 * 8-Bit ANSEL
47 *
48 * The 8-Bit ANSEL (American National Standard for Extended Latin
49 * Alphabet Coded Character Set for Bibliographic Use, Z39.47, 1985
50 * copyright) is the default character set for GEDCOM. [...]
51 * The ANSEL standard
52 * specifies an extended 8-bit configuration (above 128) to represent the
53 * spacing and non-spacing graphic characters that make up most of the
54 * Latin based languages. ANSEL is a super-set of ASCII. The standard
55 * ASCII characters including the control characters are preserved.
56 *
57 * ANSEL is known by two other names: (1) ANSI Z39.47-1985) and (2) the
58 * American Library Association character set, used in library systems
59 * worldwide, including the MARC (MAchine- Readable Catalog) format.
60 *
61 * A description of the codes for the ANSEL character set has been
62 * reproduced with permission and is included with the printed version of
63 * The GEDCOM Standard. The description of ANSEL codes is not included in
64 * the electronic version. This description may be purchased from the
65 * American National Standards Institute at 1430 Broadway, New York,
66 * N.Y. 10018. The description of the ANSEL character set standard
67 * includes the following:
68 *
69 * * An 8-Bit Code Table showing the ASCII and extended ANSEL codes
70 * * An explanation or legend of these codes
71 * * A chart that identifies the ANSEL Non-spacing Graphic Characters
72 * * A chart that identifies the ASCII Control Characters
73 * * A chart that identifies the ASCII Graphic Characters
74 *
75 * Character-set codes 0 through 127 are the same for 8-Bit ANSEL and
76 * 8-Bit ASCII (USA version-- ANSI 8-Bit). Character-set codes 128
77 * through 255 are unique to the ANSEL character set.
78 *
79 * Changes
80 * ========
81 * Fix ansel characters
82 *
83 * Capital C with cedilla
84 * Lower case C with cedilla
85 * Capital ETH
86 * Lower case eth
87 * Capital O with slash
88 * Capital Y with acute accent
89 * Lower case Icelandic thorn
90 * capital OE ligature
91 *
92 * Thanks to Larry E. Dixson <[email protected]>
93 *
94 */
95
96
97 /* Step name: ansel_latin1. */
98
99 %%
100
101 \241 { recode_put_byte (76, subtask); }
102 \242 { recode_put_byte (216, subtask); }
103 \243 { recode_put_byte (208, subtask); }
104 \244 { recode_put_byte (222, subtask); }
105 \245 { recode_put_byte (198, subtask); }
106
107 \253 { recode_put_byte (177, subtask); }
108
109 \261 { recode_put_byte (108, subtask); }
110 \262 { recode_put_byte (248, subtask); }
111 \263 { recode_put_byte (240, subtask); }
112 \264 { recode_put_byte (254, subtask); }
113 \265 { recode_put_byte (230, subtask); }
114 \266 { recode_put_byte (111, subtask); }
115
116 \271 { recode_put_byte (163, subtask); }
117
118 \303 { recode_put_byte (169, subtask); }
119 \340 { recode_put_byte (191, subtask); }
120 \341A { recode_put_byte (192, subtask); }
121 \341E { recode_put_byte (200, subtask); }
122 \341I { recode_put_byte (204, subtask); }
123 \341O { recode_put_byte (210, subtask); }
124 \341U { recode_put_byte (217, subtask); }
125 \341a { recode_put_byte (224, subtask); }
126 \341e { recode_put_byte (232, subtask); }
127 \341i { recode_put_byte (236, subtask); }
128 \341o { recode_put_byte (242, subtask); }
129 \341u { recode_put_byte (249, subtask); }
130
131 \342A { recode_put_byte (193, subtask); }
132 \342E { recode_put_byte (201, subtask); }
133 \342I { recode_put_byte (205, subtask); }
134 \342O { recode_put_byte (211, subtask); }
135 \342U { recode_put_byte (218, subtask); }
136 \342Y { recode_put_byte (221, subtask); }
137
138 \342a { recode_put_byte (225, subtask); }
139 \342e { recode_put_byte (233, subtask); }
140 \342i { recode_put_byte (237, subtask); }
141 \342o { recode_put_byte (243, subtask); }
142 \342u { recode_put_byte (250, subtask); }
143 \342y { recode_put_byte (253, subtask); }
144
145 \343A { recode_put_byte (194, subtask); }
146 \343E { recode_put_byte (202, subtask); }
147 \343I { recode_put_byte (206, subtask); }
148 \343O { recode_put_byte (212, subtask); }
149 \343U { recode_put_byte (219, subtask); }
150
151 \343a { recode_put_byte (226, subtask); }
152 \343e { recode_put_byte (234, subtask); }
153 \343i { recode_put_byte (238, subtask); }
154 \343o { recode_put_byte (244, subtask); }
155 \343u { recode_put_byte (251, subtask); }
156
157 \344A { recode_put_byte (195, subtask); }
158 \344O { recode_put_byte (213, subtask); }
159 \344N { recode_put_byte (209, subtask); }
160 \344a { recode_put_byte (227, subtask); }
161 \344o { recode_put_byte (245, subtask); }
162 \344n { recode_put_byte (241, subtask); }
163
164 \345 { recode_put_byte (175, subtask); }
165
166 \350A { recode_put_byte (196, subtask); }
167 \350E { recode_put_byte (203, subtask); }
168 \350I { recode_put_byte (207, subtask); }
169 \350O { recode_put_byte (214, subtask); }
170 \350U { recode_put_byte (220, subtask); }
171
172 \350a { recode_put_byte (228, subtask); }
173 \350e { recode_put_byte (235, subtask); }
174 \350i { recode_put_byte (239, subtask); }
175 \350o { recode_put_byte (246, subtask); }
176 \350u { recode_put_byte (252, subtask); }
177 \350y { recode_put_byte (255, subtask); }
178
179 \352A { recode_put_byte (197, subtask); }
180 \352a { recode_put_byte (229, subtask); }
181
182 \360C { recode_put_byte (199, subtask); }
183 \360c { recode_put_byte (231, subtask); }
184 %%
185
186 bool
187 module_ansel_latin1 (RECODE_OUTER outer)
188 {
189 return recode_declare_single (outer, "Z39.47:1993", "Latin-1",
190 outer->quality_variable_to_byte, NULL,
191 transform_ansel_latin1)
192 && recode_declare_alias (outer, "8bitANSEL", "Z39.47:1993")
193 && recode_declare_alias (outer, "Z39.47", "Z39.47:1993")
194 && recode_declare_alias (outer, "ANSEL", "Z39.47:1993")
195 && recode_declare_alias (outer, "USMARC", "Z39.47:1993")
196 && recode_declare_alias (outer, "MARC", "Z39.47:1993")
197 && recode_declare_alias (outer, "LOC", "Z39.47:1993"); /* Library of Congress */
198 }
199
200 void
201 delmodule_ansel_latin1 (RECODE_OUTER outer)
202 {
203 }