|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| |
|
16 |
| |
|
17 |
| |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| package nu.xom; |
|
23 |
| |
|
24 |
| import java.io.Writer; |
|
25 |
| |
|
26 |
| |
|
27 |
| |
|
28 |
| |
|
29 |
| |
|
30 |
| |
|
31 |
| |
|
32 |
| |
|
33 |
| |
|
34 |
| |
|
35 |
| |
|
36 |
| |
|
37 |
| class Latin9Writer extends TextWriter { |
|
38 |
| |
|
39 |
| |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
| |
|
46 |
| |
|
47 |
| |
|
48 |
1
| Latin9Writer(Writer out, String encoding) {
|
|
49 |
1
| super(out, encoding);
|
|
50 |
| } |
|
51 |
| |
|
52 |
| |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
| |
|
59 |
| |
|
60 |
| |
|
61 |
| |
|
62 |
255084
| boolean needsEscaping(char c) {
|
|
63 |
191250
| if (c <= 0xA3 ) return false;
|
|
64 |
1
| if (c == 0x20AC) return false;
|
|
65 |
| |
|
66 |
63833
| switch (c) {
|
|
67 |
1
| case 0x00A5: return false;
|
|
68 |
1
| case 0x00A6: return true;
|
|
69 |
1
| case 0x00A7: return false;
|
|
70 |
1
| case 0x00A8: return true;
|
|
71 |
1
| case 0x00A9: return false;
|
|
72 |
1
| case 0x00AA: return false;
|
|
73 |
1
| case 0x00AB: return false;
|
|
74 |
1
| case 0x00AC: return false;
|
|
75 |
1
| case 0x00AD: return false;
|
|
76 |
1
| case 0x00AE: return false;
|
|
77 |
1
| case 0x00AF: return false;
|
|
78 |
1
| case 0x00B0: return false;
|
|
79 |
1
| case 0x00B1: return false;
|
|
80 |
1
| case 0x00B2: return false;
|
|
81 |
1
| case 0x00B3: return false;
|
|
82 |
1
| case 0x00B4: return true;
|
|
83 |
1
| case 0x00B5: return false;
|
|
84 |
1
| case 0x00B6: return false;
|
|
85 |
1
| case 0x00B7: return false;
|
|
86 |
1
| case 0x00B8: return true;
|
|
87 |
1
| case 0x00B9: return false;
|
|
88 |
1
| case 0x00BA: return false;
|
|
89 |
1
| case 0x00BB: return false;
|
|
90 |
1
| case 0x00BC: return true;
|
|
91 |
1
| case 0x00BD: return true;
|
|
92 |
1
| case 0x00BE: return true;
|
|
93 |
1
| case 0x00BF: return false;
|
|
94 |
1
| case 0x00C0: return false;
|
|
95 |
1
| case 0x00C1: return false;
|
|
96 |
1
| case 0x00C2: return false;
|
|
97 |
1
| case 0x00C3: return false;
|
|
98 |
1
| case 0x00C4: return false;
|
|
99 |
1
| case 0x00C5: return false;
|
|
100 |
1
| case 0x00C6: return false;
|
|
101 |
1
| case 0x00C7: return false;
|
|
102 |
1
| case 0x00C8: return false;
|
|
103 |
1
| case 0x00C9: return false;
|
|
104 |
1
| case 0x00CA: return false;
|
|
105 |
1
| case 0x00CB: return false;
|
|
106 |
1
| case 0x00CC: return false;
|
|
107 |
1
| case 0x00CD: return false;
|
|
108 |
1
| case 0x00CE: return false;
|
|
109 |
1
| case 0x00CF: return false;
|
|
110 |
1
| case 0x00D0: return false;
|
|
111 |
1
| case 0x00D1: return false;
|
|
112 |
1
| case 0x00D2: return false;
|
|
113 |
1
| case 0x00D3: return false;
|
|
114 |
1
| case 0x00D4: return false;
|
|
115 |
1
| case 0x00D5: return false;
|
|
116 |
1
| case 0x00D6: return false;
|
|
117 |
1
| case 0x00D7: return false;
|
|
118 |
1
| case 0x00D8: return false;
|
|
119 |
1
| case 0x00D9: return false;
|
|
120 |
1
| case 0x00DA: return false;
|
|
121 |
1
| case 0x00DB: return false;
|
|
122 |
1
| case 0x00DC: return false;
|
|
123 |
1
| case 0x00DD: return false;
|
|
124 |
1
| case 0x00DE: return false;
|
|
125 |
1
| case 0x00DF: return false;
|
|
126 |
1
| case 0x00E0: return false;
|
|
127 |
1
| case 0x00E1: return false;
|
|
128 |
1
| case 0x00E2: return false;
|
|
129 |
1
| case 0x00E3: return false;
|
|
130 |
1
| case 0x00E4: return false;
|
|
131 |
1
| case 0x00E5: return false;
|
|
132 |
1
| case 0x00E6: return false;
|
|
133 |
1
| case 0x00E7: return false;
|
|
134 |
1
| case 0x00E8: return false;
|
|
135 |
1
| case 0x00E9: return false;
|
|
136 |
1
| case 0x00EA: return false;
|
|
137 |
1
| case 0x00EB: return false;
|
|
138 |
1
| case 0x00EC: return false;
|
|
139 |
1
| case 0x00ED: return false;
|
|
140 |
1
| case 0x00EE: return false;
|
|
141 |
1
| case 0x00EF: return false;
|
|
142 |
1
| case 0x00F0: return false;
|
|
143 |
1
| case 0x00F1: return false;
|
|
144 |
1
| case 0x00F2: return false;
|
|
145 |
1
| case 0x00F3: return false;
|
|
146 |
1
| case 0x00F4: return false;
|
|
147 |
1
| case 0x00F5: return false;
|
|
148 |
1
| case 0x00F6: return false;
|
|
149 |
1
| case 0x00F7: return false;
|
|
150 |
1
| case 0x00F8: return false;
|
|
151 |
1
| case 0x00F9: return false;
|
|
152 |
1
| case 0x00FA: return false;
|
|
153 |
1
| case 0x00FB: return false;
|
|
154 |
1
| case 0x00FC: return false;
|
|
155 |
1
| case 0x00FD: return false;
|
|
156 |
1
| case 0x00FE: return false;
|
|
157 |
1
| case 0x00FF: return false;
|
|
158 |
| } |
|
159 |
63742
| switch (c) {
|
|
160 |
1
| case 0x0152: return false;
|
|
161 |
1
| case 0x0153: return false;
|
|
162 |
1
| case 0x0154: return true;
|
|
163 |
1
| case 0x0155: return true;
|
|
164 |
1
| case 0x0156: return true;
|
|
165 |
1
| case 0x0157: return true;
|
|
166 |
1
| case 0x0158: return true;
|
|
167 |
1
| case 0x0159: return true;
|
|
168 |
1
| case 0x015A: return true;
|
|
169 |
1
| case 0x015B: return true;
|
|
170 |
1
| case 0x015C: return true;
|
|
171 |
1
| case 0x015D: return true;
|
|
172 |
1
| case 0x015E: return true;
|
|
173 |
1
| case 0x015F: return true;
|
|
174 |
1
| case 0x0160: return false;
|
|
175 |
1
| case 0x0161: return false;
|
|
176 |
1
| case 0x0162: return true;
|
|
177 |
1
| case 0x0163: return true;
|
|
178 |
1
| case 0x0164: return true;
|
|
179 |
1
| case 0x0165: return true;
|
|
180 |
1
| case 0x0166: return true;
|
|
181 |
1
| case 0x0167: return true;
|
|
182 |
1
| case 0x0168: return true;
|
|
183 |
1
| case 0x0169: return true;
|
|
184 |
1
| case 0x016A: return true;
|
|
185 |
1
| case 0x016B: return true;
|
|
186 |
1
| case 0x016C: return true;
|
|
187 |
1
| case 0x016D: return true;
|
|
188 |
1
| case 0x016E: return true;
|
|
189 |
1
| case 0x016F: return true;
|
|
190 |
1
| case 0x0170: return true;
|
|
191 |
1
| case 0x0171: return true;
|
|
192 |
1
| case 0x0172: return true;
|
|
193 |
1
| case 0x0173: return true;
|
|
194 |
1
| case 0x0174: return true;
|
|
195 |
1
| case 0x0175: return true;
|
|
196 |
1
| case 0x0176: return true;
|
|
197 |
1
| case 0x0177: return true;
|
|
198 |
1
| case 0x0178: return false;
|
|
199 |
1
| case 0x017D: return false;
|
|
200 |
1
| case 0x017E: return false;
|
|
201 |
| } |
|
202 |
| |
|
203 |
63701
| return true;
|
|
204 |
| |
|
205 |
| } |
|
206 |
| |
|
207 |
| } |