Ctype patch for review

Andrey Chernov ache at nagual.pp.ru
Mon Sep 17 02:21:33 PDT 2007


On Mon, Sep 17, 2007 at 10:29:21AM +0200, Petr Hroudn?? wrote:
> 2007/9/16, Andrey Chernov <ache at nagual.pp.ru>:
> > The problem is: currently our single byte ctype functions are broken for
> > wide characters locales in the argument range >= 0x80 - they may return
> > false positives.
> >
> > For example, for UTF-8 locale we currently have:
> > iswspace(0xA0)==1 and isspace(0xA0)==1
> > (because iswspace() and isspace() are the same code)
> > but must have
> > isspace(0xA0)==0
> 
> This is exactly what happens on other OSes and I agree this is the
> right behaviour
> for UTF-8. However, we must ensure, that:
> 
> for C locale:  isspace(0xA0)==0
> for ISO8859-* locales: isspace(0xA0)==1
> for UTF-8 locales: isspace(0xA0)==0

The patch test for wide char locale presence first (__mb_cur_max > 1), so 
does not affect single byte locales like ISO8859-*

-- 
http://ache.pp.ru/


More information about the freebsd-i18n mailing list