Ctype patch for review

From: Andrey Chernov <ache_at_nagual.pp.ru>
Date: Sun, 16 Sep 2007 23:29:24 +0400
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
(because there is no such character and all others in the range 
0x80..0xff for the wide locales, they keep ASCII only in the single byte 
range because our internal wchar_t representation is UCS-4).

Attached patch address this issue and also fix iswascii()
(currently iswascii() is broken for arguments > 0xFF).
This patch is 100% binary compatible with old binaries, their (broken) 
behaviour is not changed.

I want to hear some comments.

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

Received on Sun Sep 16 2007 - 17:40:05 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:17 UTC