[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[mgp-users-jp 01391] %charset and m17n lib
- To: mgp-users-jp@mew.org
- Subject: [mgp-users-jp 01391] %charset and m17n lib
- From: Fumitoshi UKAI <ukai@debian.or.jp>
- Date: Wed, 20 Apr 2005 01:39:19 +0900
- Delivered-to: mailing list mgp-users-jp@mew.org
- Mailing-list: contact mgp-users-jp-help@mew.org; run by ezmlm
- Organization: Debian JP Project
- User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)
m17n libを使うと %charset が無視されてしまうようです。
このパッチでいいでしょうか?
--- mgp-1.11b.orig/m17n.c
+++ mgp-1.11b/m17n.c
@@ -151,6 +151,10 @@
return cached_mt[i];
}
+ if (!mt && mgp_charset[0] != '\0') {
+ coding = mconv_resolve_coding (msymbol (mgp_charset));
+ if (coding) mt = mconv_decode_buffer (coding, p, len);
+ }
if (strchr (p, '\033')) {
/* Try ISO-2022 encoding. */
coding = mconv_resolve_coding (msymbol ("iso-2022-7bit"));
@@ -165,6 +169,12 @@
/* Try the encoding of the current locale. */
mt = mconv_decode_buffer (Mnil, p, len);
}
+ if (!mt) {
+ /* XXX: wrong encoding? */
+ fprintf(stderr, "unexpected byte sequence found.\n");
+ fprintf(stderr, " (expecting: %s (by %%charset), iso-2022-7bit, utf-8, default encoding of locale)\n", mgp_charset);
+ exit(1);
+ }
bzero(cached_txt[cached_count], BUFSIZ);
if (cached_mt[cached_count])
--
鵜飼文敏