locales: Enforce US-ASCII encoding (limited to 7-bit)
authorbapt <bapt@FreeBSD.org>
Mon, 9 Nov 2015 22:06:22 +0000 (22:06 +0000)
committerbapt <bapt@FreeBSD.org>
Mon, 9 Nov 2015 22:06:22 +0000 (22:06 +0000)
commit439f8fc61698dfd5b293fb267a7709b048b4f3f3
treecf4ba922cb9af391090f8c61b4c8cee01ce5360b
parent33b03994ad53fe3c3ece88734649d72761b03710
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".

Discussed with: ache
Submitted by: marino
Obtained from: DragonflyBSD
lib/libc/locale/Makefile.inc
lib/libc/locale/mblocal.h
lib/libc/locale/nl_langinfo.c
lib/libc/locale/setrunelocale.c