Question about ASCII and nl_langinfo (locale work)
Andrey Chernov
ache at freebsd.org
Wed Nov 11 16:59:12 UTC 2015
On 11.11.2015 1:26, Baptiste Daroussin wrote:
> The thing is not all are aware that FreeBSD uses US-ASCII, for example tcl does
> not. which means tcl is not able to determine what encoding is needed for the C
> and POSIX locales.
>
> On Linux they to return ANSI_X3.4-1968 (also known as US-ASCII) and most
> application knows what linux returns.
>
> That means we need to teach all upstream about US-ASCII all the time.
>
> The proposals are:
> - Do not change what we have always done.
> - Change it to something that makes sense "C" (what we tried with "POSIX" which
> was a very bad idea, but "C" seems to be commonly recognised by application as
> ASCII)
> - Let's report the same as Linux, that will simplify portability
> - Let's be obvious and report ASCII (also commonly recognised by applications)
Just repeating my opinion in this new thread.
Since POSIX don't tell anything certain, we should be Linux compatible
here to have less surprise, i.e.:
1) Return "ANSI_X3.4-1968" for C/POSIX locale (was "US-ASCII").
2) Return "ASCII" for *.US-ASCII locales (was "US-ASCII").
Typical Linux program knows nothing about our "US-ASCII", and porting
handles it rarely.
Not doing that leads to hidden, hard to find bugs like still present
right now in our tcl ports. For all that years tcl don't understand
FreeBSD-native nl_langinfo() "US-ASCII" and falls back to "iso8859-1"
(it understands Linux "ANSI_X3.4-1968" and "ASCII" of course).
--
http://ache.vniz.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20151111/630b2762/attachment.bin>
More information about the freebsd-arch
mailing list