From owner-freebsd-ports Mon Mar 11 12:53:31 2002 Delivered-To: freebsd-ports@freebsd.org Received: from alcatraz.iptelecom.net.ua (alcatraz.iptelecom.net.ua [212.9.224.15]) by hub.freebsd.org (Postfix) with ESMTP id 2E0CE37B405; Mon, 11 Mar 2002 12:53:04 -0800 (PST) Received: from ipcard.iptcom.net (ipcard.iptcom.net [212.9.224.5]) by alcatraz.iptelecom.net.ua (8.9.3/8.9.3) with ESMTP id WAA80662; Mon, 11 Mar 2002 22:52:52 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from vega.vega.com (h83.229.dialup.iptcom.net [212.9.229.83]) by ipcard.iptcom.net (8.9.3/8.9.3) with ESMTP id WAA08855; Mon, 11 Mar 2002 22:52:49 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Received: from FreeBSD.org (big_brother.vega.com [192.168.1.1]) by vega.vega.com (8.11.6/8.11.3) with ESMTP id g2BKqHB69524; Mon, 11 Mar 2002 22:52:17 +0200 (EET) (envelope-from sobomax@FreeBSD.org) Message-ID: <3C8D1936.999662C8@FreeBSD.org> Date: Mon, 11 Mar 2002 22:53:10 +0200 From: Maxim Sobolev Organization: Vega International Capital X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U) X-Accept-Language: en,uk,ru MIME-Version: 1.0 To: SASAKI Katuhiro Cc: gnome@FreeBSD.org, ports@FreeBSD.org Subject: Re: The libcharset library does not know some locales. References: <3c88cd22.6664%sahiro@crest.ocn.ne.jp> Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Could you please submit your patch to libiconv developers instead (Bruno Haible ), because it is clearly not FreeBSD specific. This would be a much better way to get it integrated into the tree. Thank you! -Maxim SASAKI Katuhiro wrote: > > Hi. > > I found that locale_charset() function in libcharset library (which is > provided by converters/libiconv) does not know "ja_JP.eucJP", > "ko_KR.eucKR" and "zh_CN.eucCN". > I attach a small code for test and a patch. > > To confirm this problem, please compile below code with -lcharset and > run it under latest 4.5-STABLE. If locale_charset() knows ja_JP.eucJP", > this small program must return "EUC-JP". But it will return > "ja_JP.eucJP". This result is bad. > > libcharsettest.c: > #include > #include > #include > > #include > > int main() > { > char* encoding; > > setenv("LANG", "ja_JP.eucJP", 1); > setlocale(LC_CTYPE, ""); > encoding = locale_charset(); > > if (encoding) { > printf("%s%s\n", "return value is ", encoding); > } else { > printf("%s\n", "return value is null"); > } > > return 0; > } > > Applying a patch to below the skeleton of converters/libiconv will fix > this problem, I think. Please test and review. > > Thank you for reading this message. > > diff -urN /usr/ports/converters/libiconv/files/patch-ae libiconv/files/patch-ae > --- /usr/ports/converters/libiconv/files/patch-ae Mon Aug 27 23:11:27 2001 > +++ libiconv/files/patch-ae Thu Feb 28 22:17:23 2002 > @@ -1,8 +1,8 @@ > > $FreeBSD: ports/converters/libiconv/files/patch-ae,v 1.4 2001/08/27 09:39:53 sobomax Exp $ > > ---- libcharset/lib/Makefile.in.orig Thu Jun 28 01:56:56 2001 > -+++ libcharset/lib/Makefile.in Mon Aug 27 12:32:43 2001 > +--- libcharset/lib/Makefile.in.orig Thu Jun 28 07:56:56 2001 > ++++ libcharset/lib/Makefile.in Thu Feb 28 21:58:05 2002 > @@ -10,6 +10,7 @@ > local_prefix = /usr/local > exec_prefix = @exec_prefix@ > @@ -29,24 +29,24 @@ > > charset.alias: $(srcdir)/config.charset > $(SHELL) $(srcdir)/config.charset '@host@' > t-$@ > -@@ -72,11 +73,12 @@ > +@@ -72,11 +73,11 @@ > install-lib : all force > $(MKINSTALLDIRS) $(libdir) > $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcharset.la $(libdir)/libcharset.la > - test -f $(libdir)/charset.alias && orig=$(libdir)/charset.alias \ > -+ $(MKINSTALLDIRS) $(sysconfdir) > -+ test -f $(sysconfdir)/charset.alias && orig=$(sysconfdir)/charset.alias \ > - || orig=charset.alias; \ > +- || orig=charset.alias; \ > - sed -f ref-add.sed $$orig > $(libdir)/t-charset.alias; \ > - $(INSTALL_DATA) $(libdir)/t-charset.alias $(libdir)/charset.alias; \ > - rm -f $(libdir)/t-charset.alias > ++ $(MKINSTALLDIRS) $(sysconfdir) > ++ orig=charset.alias; \ > + sed -f ref-add.sed $$orig > $(sysconfdir)/t-charset.alias; \ > + $(INSTALL_DATA) $(sysconfdir)/t-charset.alias $(sysconfdir)/charset.alias; \ > + rm -f $(sysconfdir)/t-charset.alias > > # The following is needed in order to install a simple file in $(libdir) > # which is shared with other installed packages. We use a list of referencing > -@@ -88,15 +90,16 @@ > +@@ -88,16 +89,11 @@ > install : all force > $(MKINSTALLDIRS) $(DESTDIR)$(libdir) > $(LIBTOOL_INSTALL) $(INSTALL_DATA) libcharset.la $(DESTDIR)$(libdir)/libcharset.la > @@ -54,19 +54,17 @@ > - sed -f ref-add.sed $(DESTDIR)$(libdir)/charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \ > - $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \ > - rm -f $(DESTDIR)$(libdir)/t-charset.alias; \ > -+ $(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir) > -+ if test -f $(DESTDIR)$(sysconfdir)/charset.alias; then \ > -+ sed -f ref-add.sed $(DESTDIR)$(sysconfdir)/charset.alias > $(DESTDIR)$(sysconfdir)/t-charset.alias; \ > -+ $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/t-charset.alias $(DESTDIR)$(sysconfdir)/charset.alias; \ > -+ rm -f $(DESTDIR)$(sysconfdir)/t-charset.alias; \ > - else \ > - if test @GLIBC21@ = no; then \ > +- else \ > +- if test @GLIBC21@ = no; then \ > - sed -f ref-add.sed charset.alias > $(DESTDIR)$(libdir)/t-charset.alias; \ > - $(INSTALL_DATA) $(DESTDIR)$(libdir)/t-charset.alias $(DESTDIR)$(libdir)/charset.alias; \ > - rm -f $(DESTDIR)$(libdir)/t-charset.alias; \ > -+ sed -f ref-add.sed charset.alias > $(DESTDIR)$(sysconfdir)/t-charset.alias; \ > -+ $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/t-charset.alias $(DESTDIR)$(sysconfdir)/charset.alias; \ > -+ rm -f $(DESTDIR)$(sysconfdir)/t-charset.alias; \ > - fi ; \ > +- fi ; \ > ++ $(MKINSTALLDIRS) $(DESTDIR)$(sysconfdir) > ++ if test @GLIBC21@ = no; then \ > ++ sed -f ref-add.sed charset.alias > $(DESTDIR)$(sysconfdir)/t-charset.alias; \ > ++ $(INSTALL_DATA) $(DESTDIR)$(sysconfdir)/t-charset.alias $(DESTDIR)$(sysconfdir)/charset.alias; \ > ++ rm -f $(DESTDIR)$(sysconfdir)/t-charset.alias; \ > fi > > + installdirs : force > diff -urN /usr/ports/converters/libiconv/files/patch-libcharset::lib::config.charset libiconv/files/patch-libcharset::lib::config.charset > --- /usr/ports/converters/libiconv/files/patch-libcharset::lib::config.charset Thu Jan 1 09:00:00 1970 > +++ libiconv/files/patch-libcharset::lib::config.charset Thu Feb 28 22:18:48 2002 > @@ -0,0 +1,18 @@ > +$FreeBSD$ > + > +--- libcharset/lib/config.charset.orig Mon Jun 25 21:01:22 2001 > ++++ libcharset/lib/config.charset Thu Feb 28 21:27:15 2002 > +@@ -264,10 +264,13 @@ > + echo "uk_UA.KOI8-U KOI8-U" > + echo "zh_TW.BIG5 BIG5" > + echo "zh_TW.Big5 BIG5" > ++ echo "zh_CN.eucCN GB2312" > + echo "zh_CN.EUC GB2312" > ++ echo "ja_JP.eucJP EUC-JP" > + echo "ja_JP.EUC EUC-JP" > + echo "ja_JP.SJIS SHIFT_JIS" > + echo "ja_JP.Shift_JIS SHIFT_JIS" > ++ echo "ko_KR.eucKR EUC-KR" > + echo "ko_KR.EUC EUC-KR" > + ;; > + beos*) > > -- > SASAKI Katuhiro > > mailto: sahiro@crest.ocn.ne.jp > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-gnome" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message