locales: Enforce US-ASCII encoding (limited to 7-bit)
commitefb570f9639647f0a2cf312796b8f85b936b071a
authorJohn Marino <draco@marino.st>
Mon, 9 Nov 2015 21:50:27 +0000 (9 22:50 +0100)
committerJohn Marino <draco@marino.st>
Mon, 9 Nov 2015 21:55:59 +0000 (9 22:55 +0100)
treed887f7cf626895d5bce5e43b9720ad29c8dbb50c
parentbb9ecd761ad9beda9c1f15b02319d6e014b00bc8
locales: Enforce US-ASCII encoding (limited to 7-bit)

The US-ASCII format was getting treated identically to POSIX.  It is
supposed to throw an ILSEQ errno if a value of 0x80 or greater is
encountered, so let's bring back the "ASCII" handling.

While here, change nl_codeset to return US-ASCII only when the encoding
really is "US-ASCII".  Before "C" and "POSIX" encoding returned this
string, so now they return "POSIX".
lib/libc/locale/Makefile.inc
lib/libc/locale/ascii.c [new file with mode: 0644]
lib/libc/locale/mblocal.h
lib/libc/locale/nl_langinfo.c
lib/libc/locale/setrunelocale.c