1 |
matsuu 07/09/27 15:12:02 |
2 |
|
3 |
Added: w3m-0.5.2-ambwidth.patch digest-w3m-0.5.2-r1 |
4 |
Log: |
5 |
Added ambwidth patch for unicode. |
6 |
(Portage version: 2.1.3.9) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 www-client/w3m/files/w3m-0.5.2-ambwidth.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-client/w3m/files/w3m-0.5.2-ambwidth.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-client/w3m/files/w3m-0.5.2-ambwidth.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: w3m-0.5.2-ambwidth.patch |
15 |
=================================================================== |
16 |
diff -Naur w3m-0.5.2.orig/libwc/Makefile.in w3m-0.5.2/libwc/Makefile.in |
17 |
--- w3m-0.5.2.orig/libwc/Makefile.in 2004-05-03 01:44:08.000000000 +0900 |
18 |
+++ w3m-0.5.2/libwc/Makefile.in 2007-09-27 17:34:58.000000000 +0900 |
19 |
@@ -154,7 +154,7 @@ |
20 |
map/hkscs_ucs_p2.map map/gb12345_ucs.map map/johab_ucs.map \ |
21 |
map/sjis_ext_ucs.map map/gbk_ucs.map map/uhc_ucs.map map/ucs_wide.map \ |
22 |
map/ucs_combining.map map/ucs_precompose.map map/ucs_hangul.map \ |
23 |
- map/ucs_fullwidth.map |
24 |
+ map/ucs_fullwidth.map map/ucs_ambwidth.map |
25 |
uhc.o: wc.h wc_types.h ces.h ccs.h iso2022.h priv.h uhc.h wtf.h ucs.h |
26 |
utf7.o: wc.h wc_types.h ces.h ccs.h iso2022.h priv.h ucs.h utf7.h wtf.h |
27 |
utf8.o: wc.h wc_types.h ces.h ccs.h iso2022.h priv.h ucs.h utf8.h wtf.h |
28 |
diff -Naur w3m-0.5.2.orig/libwc/map/ucs_ambwidth.map w3m-0.5.2/libwc/map/ucs_ambwidth.map |
29 |
--- w3m-0.5.2.orig/libwc/map/ucs_ambwidth.map 1970-01-01 09:00:00.000000000 +0900 |
30 |
+++ w3m-0.5.2/libwc/map/ucs_ambwidth.map 2007-09-27 17:34:58.000000000 +0900 |
31 |
@@ -0,0 +1,167 @@ |
32 |
+/* |
33 |
+ * Based on Markus Kuhn's wcwidth.c: 2003-05-20 (Unicode 4.0) |
34 |
+ * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c |
35 |
+ * |
36 |
+ * { 0xF0000, 0xFFFFD } and { 0x100000, 0x10FFFD } is not contained in this |
37 |
+ * map because wc_map_range_search takes wc_uint16 argument. |
38 |
+ */ |
39 |
+ |
40 |
+#define N_ucs_ambwidth_map 154 |
41 |
+ |
42 |
+static wc_map ucs_ambwidth_map[ N_ucs_ambwidth_map ] = { |
43 |
+ { 0x00A1, 0x00A1 }, |
44 |
+ { 0x00A4, 0x00A4 }, |
45 |
+ { 0x00A7, 0x00A8 }, |
46 |
+ { 0x00AA, 0x00AA }, |
47 |
+ { 0x00AE, 0x00AE }, |
48 |
+ { 0x00B0, 0x00B4 }, |
49 |
+ { 0x00B6, 0x00BA }, |
50 |
+ { 0x00BC, 0x00BF }, |
51 |
+ { 0x00C6, 0x00C6 }, |
52 |
+ { 0x00D0, 0x00D0 }, |
53 |
+ { 0x00D7, 0x00D8 }, |
54 |
+ { 0x00DE, 0x00E1 }, |
55 |
+ { 0x00E6, 0x00E6 }, |
56 |
+ { 0x00E8, 0x00EA }, |
57 |
+ { 0x00EC, 0x00ED }, |
58 |
+ { 0x00F0, 0x00F0 }, |
59 |
+ { 0x00F2, 0x00F3 }, |
60 |
+ { 0x00F7, 0x00FA }, |
61 |
+ { 0x00FC, 0x00FC }, |
62 |
+ { 0x00FE, 0x00FE }, |
63 |
+ { 0x0101, 0x0101 }, |
64 |
+ { 0x0111, 0x0111 }, |
65 |
+ { 0x0113, 0x0113 }, |
66 |
+ { 0x011B, 0x011B }, |
67 |
+ { 0x0126, 0x0127 }, |
68 |
+ { 0x012B, 0x012B }, |
69 |
+ { 0x0131, 0x0133 }, |
70 |
+ { 0x0138, 0x0138 }, |
71 |
+ { 0x013F, 0x0142 }, |
72 |
+ { 0x0144, 0x0144 }, |
73 |
+ { 0x0148, 0x014B }, |
74 |
+ { 0x014D, 0x014D }, |
75 |
+ { 0x0152, 0x0153 }, |
76 |
+ { 0x0166, 0x0167 }, |
77 |
+ { 0x016B, 0x016B }, |
78 |
+ { 0x01CE, 0x01CE }, |
79 |
+ { 0x01D0, 0x01D0 }, |
80 |
+ { 0x01D2, 0x01D2 }, |
81 |
+ { 0x01D4, 0x01D4 }, |
82 |
+ { 0x01D6, 0x01D6 }, |
83 |
+ { 0x01D8, 0x01D8 }, |
84 |
+ { 0x01DA, 0x01DA }, |
85 |
+ { 0x01DC, 0x01DC }, |
86 |
+ { 0x0251, 0x0251 }, |
87 |
+ { 0x0261, 0x0261 }, |
88 |
+ { 0x02C4, 0x02C4 }, |
89 |
+ { 0x02C7, 0x02C7 }, |
90 |
+ { 0x02C9, 0x02CB }, |
91 |
+ { 0x02CD, 0x02CD }, |
92 |
+ { 0x02D0, 0x02D0 }, |
93 |
+ { 0x02D8, 0x02DB }, |
94 |
+ { 0x02DD, 0x02DD }, |
95 |
+ { 0x02DF, 0x02DF }, |
96 |
+ { 0x0391, 0x03A1 }, |
97 |
+ { 0x03A3, 0x03A9 }, |
98 |
+ { 0x03B1, 0x03C1 }, |
99 |
+ { 0x03C3, 0x03C9 }, |
100 |
+ { 0x0401, 0x0401 }, |
101 |
+ { 0x0410, 0x044F }, |
102 |
+ { 0x0451, 0x0451 }, |
103 |
+ { 0x2010, 0x2010 }, |
104 |
+ { 0x2013, 0x2016 }, |
105 |
+ { 0x2018, 0x2019 }, |
106 |
+ { 0x201C, 0x201D }, |
107 |
+ { 0x2020, 0x2022 }, |
108 |
+ { 0x2024, 0x2027 }, |
109 |
+ { 0x2030, 0x2030 }, |
110 |
+ { 0x2032, 0x2033 }, |
111 |
+ { 0x2035, 0x2035 }, |
112 |
+ { 0x203B, 0x203B }, |
113 |
+ { 0x203E, 0x203E }, |
114 |
+ { 0x2074, 0x2074 }, |
115 |
+ { 0x207F, 0x207F }, |
116 |
+ { 0x2081, 0x2084 }, |
117 |
+ { 0x20AC, 0x20AC }, |
118 |
+ { 0x2103, 0x2103 }, |
119 |
+ { 0x2105, 0x2105 }, |
120 |
+ { 0x2109, 0x2109 }, |
121 |
+ { 0x2113, 0x2113 }, |
122 |
+ { 0x2116, 0x2116 }, |
123 |
+ { 0x2121, 0x2122 }, |
124 |
+ { 0x2126, 0x2126 }, |
125 |
+ { 0x212B, 0x212B }, |
126 |
+ { 0x2153, 0x2154 }, |
127 |
+ { 0x215B, 0x215E }, |
128 |
+ { 0x2160, 0x216B }, |
129 |
+ { 0x2170, 0x2179 }, |
130 |
+ { 0x2190, 0x2199 }, |
131 |
+ { 0x21B8, 0x21B9 }, |
132 |
+ { 0x21D2, 0x21D2 }, |
133 |
+ { 0x21D4, 0x21D4 }, |
134 |
+ { 0x21E7, 0x21E7 }, |
135 |
+ { 0x2200, 0x2200 }, |
136 |
+ { 0x2202, 0x2203 }, |
137 |
+ { 0x2207, 0x2208 }, |
138 |
+ { 0x220B, 0x220B }, |
139 |
+ { 0x220F, 0x220F }, |
140 |
+ { 0x2211, 0x2211 }, |
141 |
+ { 0x2215, 0x2215 }, |
142 |
+ { 0x221A, 0x221A }, |
143 |
+ { 0x221D, 0x2220 }, |
144 |
+ { 0x2223, 0x2223 }, |
145 |
+ { 0x2225, 0x2225 }, |
146 |
+ { 0x2227, 0x222C }, |
147 |
+ { 0x222E, 0x222E }, |
148 |
+ { 0x2234, 0x2237 }, |
149 |
+ { 0x223C, 0x223D }, |
150 |
+ { 0x2248, 0x2248 }, |
151 |
+ { 0x224C, 0x224C }, |
152 |
+ { 0x2252, 0x2252 }, |
153 |
+ { 0x2260, 0x2261 }, |
154 |
+ { 0x2264, 0x2267 }, |
155 |
+ { 0x226A, 0x226B }, |
156 |
+ { 0x226E, 0x226F }, |
157 |
+ { 0x2282, 0x2283 }, |
158 |
+ { 0x2286, 0x2287 }, |
159 |
+ { 0x2295, 0x2295 }, |
160 |
+ { 0x2299, 0x2299 }, |
161 |
+ { 0x22A5, 0x22A5 }, |
162 |
+ { 0x22BF, 0x22BF }, |
163 |
+ { 0x2312, 0x2312 }, |
164 |
+ { 0x2460, 0x24E9 }, |
165 |
+ { 0x24EB, 0x254B }, |
166 |
+ { 0x2550, 0x2573 }, |
167 |
+ { 0x2580, 0x258F }, |
168 |
+ { 0x2592, 0x2595 }, |
169 |
+ { 0x25A0, 0x25A1 }, |
170 |
+ { 0x25A3, 0x25A9 }, |
171 |
+ { 0x25B2, 0x25B3 }, |
172 |
+ { 0x25B6, 0x25B7 }, |
173 |
+ { 0x25BC, 0x25BD }, |
174 |
+ { 0x25C0, 0x25C1 }, |
175 |
+ { 0x25C6, 0x25C8 }, |
176 |
+ { 0x25CB, 0x25CB }, |
177 |
+ { 0x25CE, 0x25D1 }, |
178 |
+ { 0x25E2, 0x25E5 }, |
179 |
+ { 0x25EF, 0x25EF }, |
180 |
+ { 0x2605, 0x2606 }, |
181 |
+ { 0x2609, 0x2609 }, |
182 |
+ { 0x260E, 0x260F }, |
183 |
+ { 0x2614, 0x2615 }, |
184 |
+ { 0x261C, 0x261C }, |
185 |
+ { 0x261E, 0x261E }, |
186 |
+ { 0x2640, 0x2640 }, |
187 |
+ { 0x2642, 0x2642 }, |
188 |
+ { 0x2660, 0x2661 }, |
189 |
+ { 0x2663, 0x2665 }, |
190 |
+ { 0x2667, 0x266A }, |
191 |
+ { 0x266C, 0x266D }, |
192 |
+ { 0x266F, 0x266F }, |
193 |
+ { 0x273D, 0x273D }, |
194 |
+ { 0x2776, 0x277F }, |
195 |
+ { 0xE000, 0xF8FF }, |
196 |
+ { 0xFFFD, 0xFFFD }, |
197 |
+}; |
198 |
+ |
199 |
diff -Naur w3m-0.5.2.orig/libwc/status.c w3m-0.5.2/libwc/status.c |
200 |
--- w3m-0.5.2.orig/libwc/status.c 2003-09-23 06:02:23.000000000 +0900 |
201 |
+++ w3m-0.5.2/libwc/status.c 2007-09-27 17:34:58.000000000 +0900 |
202 |
@@ -25,6 +25,7 @@ |
203 |
WC_FALSE, /* gb18030_as_ucs */ |
204 |
WC_FALSE, /* no_replace */ |
205 |
WC_TRUE, /* use_wide */ |
206 |
+ WC_FALSE, /* east_asian_width */ |
207 |
}; |
208 |
|
209 |
static wc_status output_st; |
210 |
diff -Naur w3m-0.5.2.orig/libwc/ucs.c w3m-0.5.2/libwc/ucs.c |
211 |
--- w3m-0.5.2.orig/libwc/ucs.c 2007-05-23 20:34:09.000000000 +0900 |
212 |
+++ w3m-0.5.2/libwc/ucs.c 2007-09-27 17:34:58.000000000 +0900 |
213 |
@@ -17,6 +17,7 @@ |
214 |
|
215 |
#include "ucs.map" |
216 |
|
217 |
+#include "map/ucs_ambwidth.map" |
218 |
#include "map/ucs_wide.map" |
219 |
#include "map/ucs_combining.map" |
220 |
#include "map/ucs_precompose.map" |
221 |
@@ -511,11 +512,26 @@ |
222 |
if (0x80 <= ucs && ucs <= 0x9F) |
223 |
return WC_CCS_C1; |
224 |
return ((ucs <= WC_C_UCS2_END) ? WC_CCS_UCS2 : WC_CCS_UCS4) |
225 |
+ | ((WcOption.east_asian_width && wc_is_ucs_ambiguous_width(ucs)) |
226 |
+ ? WC_CCS_A_WIDE : 0) |
227 |
| (wc_is_ucs_wide(ucs) ? WC_CCS_A_WIDE : 0) |
228 |
| (wc_is_ucs_combining(ucs) ? WC_CCS_A_COMB : 0); |
229 |
} |
230 |
|
231 |
wc_bool |
232 |
+wc_is_ucs_ambiguous_width(wc_uint32 ucs) |
233 |
+{ |
234 |
+ if (0xa1 <= ucs && ucs <= 0xfe && WcOption.use_jisx0213) |
235 |
+ return 1; |
236 |
+ else if (ucs <= WC_C_UCS2_END) |
237 |
+ return (wc_map_range_search((wc_uint16)ucs, |
238 |
+ ucs_ambwidth_map, N_ucs_ambwidth_map) != NULL); |
239 |
+ else |
240 |
+ return ((0xF0000 <= ucs && ucs <= 0xFFFFD) |
241 |
+ || (0x100000 <= ucs && ucs <= 0x10FFFD)); |
242 |
+} |
243 |
+ |
244 |
+wc_bool |
245 |
wc_is_ucs_wide(wc_uint32 ucs) |
246 |
{ |
247 |
if (ucs <= WC_C_UCS2_END) |
248 |
diff -Naur w3m-0.5.2.orig/libwc/ucs.h w3m-0.5.2/libwc/ucs.h |
249 |
--- w3m-0.5.2.orig/libwc/ucs.h 2007-05-23 20:34:09.000000000 +0900 |
250 |
+++ w3m-0.5.2/libwc/ucs.h 2007-09-27 17:34:58.000000000 +0900 |
251 |
@@ -44,6 +44,7 @@ |
252 |
extern wc_wchar_t wc_ucs_to_iso2022(wc_uint32 ucs); |
253 |
extern wc_wchar_t wc_ucs_to_iso2022w(wc_uint32 ucs); |
254 |
extern wc_ccs wc_ucs_to_ccs(wc_uint32 ucs); |
255 |
+extern wc_bool wc_is_ucs_ambiguous_width(wc_uint32 ucs); |
256 |
extern wc_bool wc_is_ucs_wide(wc_uint32 ucs); |
257 |
extern wc_bool wc_is_ucs_combining(wc_uint32 ucs); |
258 |
extern wc_bool wc_is_ucs_hangul(wc_uint32 ucs); |
259 |
diff -Naur w3m-0.5.2.orig/libwc/wc_types.h w3m-0.5.2/libwc/wc_types.h |
260 |
--- w3m-0.5.2.orig/libwc/wc_types.h 2004-04-05 01:47:20.000000000 +0900 |
261 |
+++ w3m-0.5.2/libwc/wc_types.h 2007-09-27 17:34:58.000000000 +0900 |
262 |
@@ -91,6 +91,7 @@ |
263 |
wc_bool gb18030_as_ucs; /* treat 4 bytes char. of GB18030 as Unicode */ |
264 |
wc_bool no_replace; /* don't output replace character */ |
265 |
wc_bool use_wide; /* use wide characters */ |
266 |
+ wc_bool east_asian_width; /* East Asian Ambiguous characters are wide */ |
267 |
} wc_option; |
268 |
|
269 |
typedef struct { |
270 |
diff -Naur w3m-0.5.2.orig/po/ja.po w3m-0.5.2/po/ja.po |
271 |
--- w3m-0.5.2.orig/po/ja.po 2007-05-31 21:17:05.000000000 +0900 |
272 |
+++ w3m-0.5.2/po/ja.po 2007-09-27 17:36:36.000000000 +0900 |
273 |
@@ -614,6 +614,10 @@ |
274 |
msgstr "結合文字を使う" |
275 |
|
276 |
#: rc.c:219 |
277 |
+msgid "Use double width for some Unicode characters" |
278 |
+msgstr "ある種のUnicode文字を全角にする" |
279 |
+ |
280 |
+#: rc.c:219 |
281 |
msgid "Use Unicode language tags" |
282 |
msgstr "Unicode の言語タグを使う" |
283 |
|
284 |
diff -Naur w3m-0.5.2.orig/po/w3m.pot w3m-0.5.2/po/w3m.pot |
285 |
--- w3m-0.5.2.orig/po/w3m.pot 2007-05-31 21:17:05.000000000 +0900 |
286 |
+++ w3m-0.5.2/po/w3m.pot 2007-09-27 17:37:12.000000000 +0900 |
287 |
@@ -613,6 +613,10 @@ |
288 |
msgstr "" |
289 |
|
290 |
#: rc.c:219 |
291 |
+msgid "Use double width for some Unicode characters" |
292 |
+msgstr "" |
293 |
+ |
294 |
+#: rc.c:219 |
295 |
msgid "Use Unicode language tags" |
296 |
msgstr "" |
297 |
|
298 |
diff -Naur w3m-0.5.2.orig/proto.h w3m-0.5.2/proto.h |
299 |
--- w3m-0.5.2.orig/proto.h 2006-04-07 22:21:12.000000000 +0900 |
300 |
+++ w3m-0.5.2/proto.h 2007-09-27 17:34:58.000000000 +0900 |
301 |
@@ -176,6 +176,9 @@ |
302 |
#define convertLine(uf,line,mode,charset,dcharset) convertLine0(uf,line,mode) |
303 |
#endif |
304 |
extern void push_symbol(Str str, char symbol, int width, int n); |
305 |
+#ifdef USE_UNICODE |
306 |
+extern void update_utf8_symbol(void); |
307 |
+#endif |
308 |
extern Buffer *loadFile(char *path); |
309 |
extern Buffer *loadGeneralFile(char *path, ParsedURL *current, char *referer, |
310 |
int flag, FormList *request); |
311 |
diff -Naur w3m-0.5.2.orig/rc.c w3m-0.5.2/rc.c |
312 |
--- w3m-0.5.2.orig/rc.c 2007-05-24 00:06:06.000000000 +0900 |
313 |
+++ w3m-0.5.2/rc.c 2007-09-27 17:34:58.000000000 +0900 |
314 |
@@ -216,6 +216,7 @@ |
315 |
#define CMT_EXT_HALFDUMP N_("Output halfdump with display charset") |
316 |
#define CMT_USE_WIDE N_("Use multi column characters") |
317 |
#define CMT_USE_COMBINING N_("Use combining characters") |
318 |
+#define CMT_EAST_ASIAN_WIDTH N_("Use double width for some Unicode characters") |
319 |
#define CMT_USE_LANGUAGE_TAG N_("Use Unicode language tags") |
320 |
#define CMT_UCS_CONV N_("Charset conversion using Unicode map") |
321 |
#define CMT_PRE_CONV N_("Charset conversion when loading") |
322 |
@@ -640,6 +641,8 @@ |
323 |
{"use_combining", P_CHARINT, PI_ONOFF, (void *)&WcOption.use_combining, |
324 |
CMT_USE_COMBINING, NULL}, |
325 |
#ifdef USE_UNICODE |
326 |
+ {"east_asian_width", P_CHARINT, PI_ONOFF, |
327 |
+ (void *)&WcOption.east_asian_width, CMT_EAST_ASIAN_WIDTH, NULL}, |
328 |
{"use_language_tag", P_CHARINT, PI_ONOFF, |
329 |
(void *)&WcOption.use_language_tag, CMT_USE_LANGUAGE_TAG, NULL}, |
330 |
{"ucs_conv", P_CHARINT, PI_ONOFF, (void *)&WcOption.ucs_conv, CMT_UCS_CONV, |
331 |
@@ -1172,6 +1175,9 @@ |
332 |
AcceptEncoding = acceptableEncoding(); |
333 |
if (AcceptMedia == NULL || *AcceptMedia == '\0') |
334 |
AcceptMedia = acceptableMimeTypes(); |
335 |
+#ifdef USE_UNICODE |
336 |
+ update_utf8_symbol(); |
337 |
+#endif |
338 |
if (fmInitialized) { |
339 |
initKeymap(FALSE); |
340 |
#ifdef USE_MOUSE |
341 |
diff -Naur w3m-0.5.2.orig/symbol.c w3m-0.5.2/symbol.c |
342 |
--- w3m-0.5.2.orig/symbol.c 2003-09-23 06:02:21.000000000 +0900 |
343 |
+++ w3m-0.5.2/symbol.c 2007-09-27 17:34:58.000000000 +0900 |
344 |
@@ -18,7 +18,7 @@ |
345 |
wc_ces ces; |
346 |
char width; |
347 |
char **item; |
348 |
- char encode; |
349 |
+ char **conved_item; |
350 |
} symbol_set; |
351 |
|
352 |
typedef struct { |
353 |
@@ -27,17 +27,17 @@ |
354 |
} charset_symbol_set; |
355 |
|
356 |
/* *INDENT-OFF* */ |
357 |
-static symbol_set alt_symbol_set = { WC_CES_US_ASCII, 1, alt_symbol, 1 }; |
358 |
-static symbol_set alt2_symbol_set = { WC_CES_US_ASCII, 2, alt2_symbol, 1 }; |
359 |
-static symbol_set eucjp_symbol_set = { WC_CES_EUC_JP, 2, eucjp_symbol, 0 }; |
360 |
-static symbol_set euckr_symbol_set = { WC_CES_EUC_KR, 2, euckr_symbol, 0 }; |
361 |
-static symbol_set euccn_symbol_set = { WC_CES_EUC_CN, 2, euccn_symbol, 0 }; |
362 |
-static symbol_set euctw_symbol_set = { WC_CES_EUC_TW, 2, euctw_symbol, 0 }; |
363 |
-static symbol_set big5_symbol_set = { WC_CES_BIG5, 2, big5_symbol, 0 }; |
364 |
+static symbol_set alt_symbol_set = { WC_CES_US_ASCII, 1, alt_symbol, alt_symbol }; |
365 |
+static symbol_set alt2_symbol_set = { WC_CES_US_ASCII, 2, alt2_symbol, alt2_symbol }; |
366 |
+static symbol_set eucjp_symbol_set = { WC_CES_EUC_JP, 2, eucjp_symbol, NULL }; |
367 |
+static symbol_set euckr_symbol_set = { WC_CES_EUC_KR, 2, euckr_symbol, NULL }; |
368 |
+static symbol_set euccn_symbol_set = { WC_CES_EUC_CN, 2, euccn_symbol, NULL }; |
369 |
+static symbol_set euctw_symbol_set = { WC_CES_EUC_TW, 2, euctw_symbol, NULL }; |
370 |
+static symbol_set big5_symbol_set = { WC_CES_BIG5, 2, big5_symbol, NULL }; |
371 |
#ifdef USE_UNICODE |
372 |
-static symbol_set utf8_symbol_set = { WC_CES_UTF_8, 1, utf8_symbol, 0 }; |
373 |
+static symbol_set utf8_symbol_set = { WC_CES_UTF_8, 1, utf8_symbol, NULL }; |
374 |
#endif |
375 |
-static symbol_set cp850_symbol_set = { WC_CES_CP850, 1, cp850_symbol, 0 }; |
376 |
+static symbol_set cp850_symbol_set = { WC_CES_CP850, 1, cp850_symbol, NULL }; |
377 |
|
378 |
static charset_symbol_set charset_symbol_list[] = { |
379 |
{ WC_CES_EUC_JP, &eucjp_symbol_set }, |
380 |
@@ -73,11 +73,12 @@ |
381 |
{ |
382 |
int i; |
383 |
|
384 |
+ for (i = 0; s->item[i]; i++) ; |
385 |
+ s->conved_item = New_N(char *, i); |
386 |
for (i = 0; s->item[i]; i++) { |
387 |
if (*(s->item[i])) |
388 |
- s->item[i] = wc_conv(s->item[i], s->ces, InnerCharset)->ptr; |
389 |
+ s->conved_item[i] = wc_conv(s->item[i], s->ces, InnerCharset)->ptr; |
390 |
} |
391 |
- s->encode = 1; |
392 |
} |
393 |
|
394 |
char ** |
395 |
@@ -89,7 +90,7 @@ |
396 |
if (charset == save_charset && save_symbol != NULL && |
397 |
*width == save_symbol->width) { |
398 |
*width = save_symbol->width; |
399 |
- return save_symbol->item; |
400 |
+ return save_symbol->conved_item; |
401 |
} |
402 |
save_charset = charset; |
403 |
for (p = charset_symbol_list; p->charset; p++) { |
404 |
@@ -102,12 +103,12 @@ |
405 |
if (s == NULL) |
406 |
s = (*width == 2) ? &alt2_symbol_set : &alt_symbol_set; |
407 |
if (s != save_symbol) { |
408 |
- if (!s->encode) |
409 |
+ if (!s->conved_item) |
410 |
encode_symbol(s); |
411 |
save_symbol = s; |
412 |
} |
413 |
*width = s->width; |
414 |
- return s->item; |
415 |
+ return s->conved_item; |
416 |
} |
417 |
|
418 |
char ** |
419 |
@@ -137,6 +138,21 @@ |
420 |
return symbol_buf; |
421 |
} |
422 |
|
423 |
+#ifdef USE_UNICODE |
424 |
+void |
425 |
+update_utf8_symbol(void) |
426 |
+{ |
427 |
+ charset_symbol_set *p; |
428 |
+ utf8_symbol_set.width = WcOption.east_asian_width ? 2 : 1; |
429 |
+ for (p = charset_symbol_list; p->charset; p++) { |
430 |
+ if (p->charset == WC_CES_UTF_8) { |
431 |
+ encode_symbol(p->symbol); |
432 |
+ break; |
433 |
+ } |
434 |
+ } |
435 |
+} |
436 |
+#endif |
437 |
+ |
438 |
#else |
439 |
|
440 |
char ** |
441 |
|
442 |
|
443 |
|
444 |
1.1 www-client/w3m/files/digest-w3m-0.5.2-r1 |
445 |
|
446 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-client/w3m/files/digest-w3m-0.5.2-r1?rev=1.1&view=markup |
447 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/www-client/w3m/files/digest-w3m-0.5.2-r1?rev=1.1&content-type=text/plain |
448 |
|
449 |
Index: digest-w3m-0.5.2-r1 |
450 |
=================================================================== |
451 |
MD5 ba06992d3207666ed1bf2dcf7c72bf58 w3m-0.5.2.tar.gz 1906812 |
452 |
RMD160 09ce72d8ef5e621a2e49496b63e22f2773edbe79 w3m-0.5.2.tar.gz 1906812 |
453 |
SHA256 5ff3e5a1f50a4a8e6ddbfdeefbe13d3a7f63538595a8e29f5da504ea46eda646 w3m-0.5.2.tar.gz 1906812 |
454 |
|
455 |
|
456 |
|
457 |
-- |
458 |
gentoo-commits@g.o mailing list |