[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mgp-users-jp 01392] Re: %charset and m17n lib



レプライが遅くなってしまってすみません。
この辺の処理の実装は全体的にデザインを見直した方がいい感じなのですが、
とりあえずこれでよさそうです。commitしておきます。
ありがとうございます。
--
西田佳史
Yoshifumi Nishida
nishida@csl.sony.co.jp


From: Fumitoshi UKAI <ukai@debian.or.jp>
Subject: [mgp-users-jp 01391] %charset and m17n lib
Date: Wed, 20 Apr 2005 01:39:19 +0900
Message-ID: <>

 > 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]) 
 > 
 > -- 
 > 鵜飼文敏
 >