History log of /freebsd-9.3-release/lib/libc/locale/gb2312.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 235785 22-May-2012 theraven

MFC the xlocale implementation.

Merged revisions: 227487,227753,227807,227818,227999,228002,228875,230156,231673,232498,232601,232620,232626,232926-232927,232929,232931,232935,233173,233600,234573,234578,235239

This currently defines __NO_TLS on ARM (unlike head), because the required
support function has not been MFC'd.


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 172619 13-Oct-2007 ache

The problem is: currently our single byte ctype(3) functions are broken
for wide characters locales in the argument range >= 0x80 - they may
return false positives.

Example 1: 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
iswspace(0xA0)==1 and isspace(0xA0)==0
(because there is no such character and all others in the range
0x80..0xff for the UTF-8 locale, it keeps ASCII only in the single byte
range because our internal wchar_t representation for UTF-8 is UCS-4).

Example 2: for all wide character locales isalpha(arg) when arg > 0xFF may
return false positives (must be 0).
(because iswalpha() and isalpha() are the same code)

This change address this issue separating single byte and wide ctype
and also fix iswascii() (currently iswascii() is broken for
arguments > 0xFF).
This change is 100% binary compatible with old binaries.

Reviewied by: i18n@


# 142654 27-Feb-2005 phantom

. Static'ize functions exported via function reference variables only.
. Replace inclusion of sys/param.h to sys/cdefs.h and sys/types.h where
appropriate.
. move _*_init() prototypes to mblocal.h, and remove these prototypes
from .c files
. use _none_init() in __setrunelocale() instead of duplicating code
. move __mb* variables from table.c to none.c allowing us to not to
export _none_*() externs, and appropriately remove them from mblocal.h

Ok'ed by: tjr


# 129153 12-May-2004 tjr

Move prototypes of various encoding-related functions into a new header
file to avoid extern'ing them all over the place.


# 128155 12-Apr-2004 tjr

Perform some basic validation of multibyte conversion state objects.


# 128089 10-Apr-2004 davidxu

Fix a typo. I was locked out for two days from my machine.


# 128081 09-Apr-2004 tjr

Don't cast away const qualifiers.

Spotted by: bde


# 128004 07-Apr-2004 tjr

Allow partial multibyte characters to accumulate in conversion state
objects passed to mbrtowc(), mbsrtowcs(), and mbrlen(), as required
by C99.


# 122283 08-Nov-2003 tjr

Remove unused #includes.


# 122282 08-Nov-2003 tjr

Use __inline instead of inline.


# 122145 05-Nov-2003 davidxu

Add gb2312 encoding.