]>
git.saurik.com Git - apple/libc.git/blob - internat.subproj/NXToAscii.c
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright 1990, NeXT, Inc.
27 #define FIXSIGNEDCHAR(i) if ((i & 0xFFFFFF80) == 0xFFFFFF80) i &= 0x000000FF
33 static unsigned char woops
[] = " ";
36 if (c
< 128) { /* handle stuff already ASCII */
38 return (unsigned char *) woops
;
41 case 128: /* Figspace */
42 return (unsigned char *) " ";
43 case 129: /* Agrave */
44 case 130: /* Aacute */
45 case 131: /* Acircumflex */
46 case 132: /* Atilde */
47 case 133: /* Adieresis */
49 return (unsigned char *) "A";
50 case 135: /* Ccedilla */
51 return (unsigned char *) "C";
52 case 136: /* Egrave */
53 case 137: /* Eacute */
54 case 138: /* Ecircumflex */
55 case 139: /* Edieresis */
56 return (unsigned char *) "E";
57 case 140: /* Igrave */
58 case 141: /* Iacute */
59 case 142: /* Icircumflex */
60 case 143: /* Idieresis */
61 return (unsigned char *) "I";
62 case 145: /* Ntilde */
63 return (unsigned char *) "N";
64 case 146: /* Ograve */
65 case 147: /* Oacute */
66 case 148: /* Ocircumflex */
67 case 149: /* Otilde */
68 case 150: /* Odieresis */
69 case 233: /* Oslash */
70 return (unsigned char *) "O";
71 case 151: /* Ugrave */
72 case 152: /* Uacute */
73 case 153: /* Ucircumflex */
74 case 154: /* Udieresis */
75 return (unsigned char *) "U";
76 case 155: /* Yacute */
77 return (unsigned char *) "Y";
80 return (unsigned char *) "TH";
83 return (unsigned char *) "th";
86 return (unsigned char *) "fi";
88 return (unsigned char *) "fl";
90 case 213: /* agrave */
91 case 214: /* aacute */
92 case 215: /* acircumflex */
93 case 216: /* atilde */
94 case 217: /* adieresis */
96 return (unsigned char *) "a";
97 case 219: /* ccedilla */
98 return (unsigned char *) "c";
99 case 220: /* egrave */
100 case 221: /* eacute */
101 case 222: /* ecircumflex */
102 case 223: /* edieresis */
103 return (unsigned char *) "e";
105 return (unsigned char *) "AE";
106 case 224: /* igrave */
107 case 226: /* iacute */
108 case 228: /* icircumflex */
109 case 229: /* idieresis */
110 return (unsigned char *) "i";
111 case 231: /* ntilde */
112 return (unsigned char *) "n";
113 case 232: /* Lslash */
114 return (unsigned char *) "L";
116 return (unsigned char *) "OE";
117 case 236: /* ograve */
118 case 237: /* oacute */
119 case 238: /* ocircumflex */
120 case 239: /* otilde */
121 case 240: /* odieresis */
122 case 249: /* oslash */
123 return (unsigned char *) "o";
125 return (unsigned char *) "ae";
126 case 242: /* ugrave */
127 case 243: /* uacute */
128 case 244: /* ucircumflex */
129 case 246: /* udieresis */
130 return (unsigned char *) "u";
131 case 245: /* dotlessi */
132 return (unsigned char *) "i";
133 case 247: /* yacute */
134 case 253: /* ydieresis */
135 return (unsigned char *) "y";
136 case 248: /* lslash */
137 return (unsigned char *) "l";
139 return (unsigned char *) "oe";
140 case 251: /* germandbls */
141 return (unsigned char *) "ss";
145 case 158: /* multiply */
146 return (unsigned char *) "x";
147 case 159: /* divide */
148 return (unsigned char *) "/";
150 case 161: /* exclamdown */
151 return (unsigned char *) "!";
152 case 169: /* quotesingle */
153 return (unsigned char *) "'";
155 case 170: /* quotedblleft */
156 case 186: /* quotedblright */
157 case 185: /* quotedblbase */
158 return (unsigned char *) "\"";
159 case 171: /* guillemotleft */
160 return (unsigned char *) "<<";
161 case 187: /* guillemotright */
162 return (unsigned char *) ">>";
163 case 184: /* quotesinglbase */
164 return (unsigned char *) "'";
165 case 172: /* guilsinglleft */
166 return (unsigned char *) "<";
167 case 173: /* guilsinglright */
168 return (unsigned char *) ">";
169 case 180: /* periodcentered */
170 return (unsigned char *) ".";
171 case 181: /* brokenbar */
172 return (unsigned char *) "|";
173 case 183: /* bullet */
174 return (unsigned char *) "*";
175 case 188: /* ellipsis */
176 return (unsigned char *) "...";
177 case 191: /* questiondown */
178 return (unsigned char *) "?";
179 case 192: /* onesuperior */
180 return (unsigned char *) "1";
181 case 201: /* twosuperior */
182 return (unsigned char *) "2";
183 case 204: /* threesuperior */
184 return (unsigned char *) "3";
185 case 208: /* emdash */
186 return (unsigned char *) "--";
187 case 209: /* plusminus */
188 return (unsigned char *) "+-";
189 case 210: /* onequarter */
190 return (unsigned char *) "1/4";
191 case 211: /* onehalf */
192 return (unsigned char *) "1/2";
193 case 212: /* threequarters */
194 return (unsigned char *) "3/4";
195 case 227: /* ordfeminine */
196 return (unsigned char *) "a";
197 case 235: /* ordmasculine */
198 return (unsigned char *) "o";
200 return (unsigned char *) "u";
201 case 160: /* copyright */
202 return (unsigned char *) "(C)";
203 case 163: /* sterling */
204 return (unsigned char *) "L";
205 case 164: /* fraction */
206 return (unsigned char *) "/";
208 return (unsigned char *) "Y";
209 case 166: /* florin */
210 return (unsigned char *) "f";
211 case 176: /* registered */
212 return (unsigned char *) "(R)";
213 case 190: /* logicalnot */
214 case 177: /* endash */
215 return (unsigned char *) "-";
216 case 178: /* dagger */
217 return (unsigned char *) "+";
218 case 179: /* daggerdbl */
219 return (unsigned char *) "++";
220 case 189: /* perthousand */
221 return (unsigned char *) "0/00";
222 case 193: /* grave */
223 return (unsigned char *) "`";
224 case 194: /* acute */
225 return (unsigned char *) "'";
226 case 195: /* circumflex */
227 return (unsigned char *) "^";
228 case 196: /* tilde */
229 return (unsigned char *) "~";
232 * Default & fallback cases:
235 case 167: /* section */
236 case 168: /* currency */
237 case 182: /* paragraph */
238 case 197: /* macron */
239 case 198: /* breve */
240 case 199: /* dotaccent */
241 case 200: /* dieresis */
243 case 203: /* cedilla */
244 case 205: /* hungarumlaut */
245 case 206: /* ogonek */
246 case 207: /* caron */
248 return (unsigned char *) "_";