JDK 10 RFR of JDK-8181395: Refactor several java/nio locale related shell tests to java
Alan Bateman
Alan.Bateman at oracle.com
Thu Jun 8 14:48:11 UTC 2017
On 07/06/2017 16:14, Amy Lu wrote:
> Defaul.java
> System.out.println(Charset.defaultCharset());
>
> The output for "nonexist" (not supported) LC_ALL is (at least on
> Solaris): US-ASCII
>
> The output is the same as set LC_ALL from commandline:
>
> $ export LC_ALL=nonexist
> bash: warning: setlocale: LC_ALL: cannot change locale (nonexist)
>
> $ echo $LC_ALL
> nonexist
>
> $ jdk/bin/java Default
> US-ASCII
>
> I'm not sure why though. Also not sure whether it's the same across
> platforms, settings. So I make it run with the "nonexist" locale to
> get the String UNSUPPORTED.
>
I assume "US-ASCII" is coming from nl_langinfo(CODESET), at least on
OSX/Linux/Solaris. I'm surprised that it prints "US-ASCII" on Windows
but maybe that needs a system without the JP locales to prove that.
-Alan.
More information about the core-libs-dev
mailing list