Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Nov 2003 16:11:50 +1100
From:      Tim Robbins <tjr@freebsd.org>
To:        Hye-Shik Chang <perky@i18n.org>
Cc:        cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/lib/libc/locale big5.c euc.c mskanji.c utf8.c
Message-ID:  <20031111051150.GB59673@wombat.robbins.dropbear.id.au>
In-Reply-To: <20031111042254.GA28372@i18n.org>
References:  <200311021009.hA2A9XTU063850@repoman.freebsd.org> <20031111042254.GA28372@i18n.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Nov 11, 2003 at 01:22:54PM +0900, Hye-Shik Chang wrote:

> On Sun, Nov 02, 2003 at 02:09:33AM -0800, Tim J. Robbins wrote:
> > tjr         2003/11/02 02:09:33 PST
> > 
> >   FreeBSD src repository
> > 
> >   Modified files:
> >     lib/libc/locale      big5.c euc.c mskanji.c utf8.c 
> >   Log:
> >   Convert the Big5, EUC, MSKanji and UTF-8 encoding methods to implement
> >   mbrtowc() and wcrtomb() directly. GB18030, GBK and UTF2 are left
> >   unconverted; GB18030 will be done eventually, but GBK and UTF2 may just
> >   be removed, as they are subsets of GB18030 and UTF-8 respectively.
> >   
> >   Revision  Changes    Path
> >   1.8       +50 -53    src/lib/libc/locale/big5.c
> >   1.12      +68 -82    src/lib/libc/locale/euc.c
> >   1.9       +46 -48    src/lib/libc/locale/mskanji.c
> >   1.3       +69 -71    src/lib/libc/locale/utf8.c
> 
> JFYI, I can't input characters in libreadline and GTK+2 on UTF-8 locales
> (ports/misc/utf8locale) after this change. (and they work again when rollback
> it to utf8.c rev 1.2)
> 
> I'm tracking it down but I don't know what's the problem exactly yet.

Ugh, sorry. Can you try this patch and let me know whether it fixes it?

--- utf8.c.old	Tue Nov 11 16:05:05 2003
+++ utf8.c	Tue Nov 11 16:05:19 2003
@@ -143,7 +143,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, 
 	}
 	if (pwc != NULL)
 		*pwc = wch;
-	return (wch == L'\0' ? 0 : i);
+	return (wch == L'\0' ? 0 : len);
 }
 
 size_t



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031111051150.GB59673>