On 6/7/17 10:21 PM, Alan Bateman wrote:


On 07/06/2017 07:14, Amy Lu wrote:
java/nio/charset/Charset/default.sh
java/nio/charset/coders/CheckSJISMappingProp.sh
java/nio/file/Path/MacPathTest.java which runs shell test:
     * @run shell MacPathTest.sh

Please review this patch to refactor these shell tests to java.

Note that in MacPathTest.sh, it requires the test to be run with LC_ALL=en_US.UTF-8 env. But unlike the other two tests, LC_ALL settings here is just to setup an env in order for the test to work correctly, it’s not the locale it intends to test.
One thing that isn't clear to me is the value of UNSUPPORTED as I assume it will contain the value "nonexist" and so don't match when testing other locales that aren't installed.

-Alan.

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.

Thanks,
Amy

Reply via email to