System properties

William Moore wmoore40 at gmail.com
Sun May 27 13:49:42 PDT 2012


Hi

I ran this on my system and got the following:

Apple Java 6:
  Default character set: MacRoman
  file.encoding.pkg: sun.io
  java.io.tmpdir: /var/folders/q6/q4kmcx3114z41thjlh_0x9f00000gn/T/
  sun.jnu.encoding: MacRoman
  file.encoding: MacRoman
  file.separator: /
  sun.io.unicode.encoding: UnicodeLittle

OpenJDK 7 Update 2:
  Default character set: UTF-8
  file.encoding.pkg: sun.io
  java.io.tmpdir: /var/folders/q6/q4kmcx3114z41thjlh_0x9f00000gn/T/
  sun.jnu.encoding: UTF-8
  file.encoding: UTF-8
  file.separator: /
  sun.io.unicode.encoding: UnicodeBig

I'm not clear what you mean by "a US system", but it does not seem to me that "it has been UTF-8 for a while".

Are there setting somewhere to control these values?

William

On 26 May 2012, at 8:56pm, Andrew Thompson wrote:

> On May 26, 2012, at 6:17 PM, Michael Hall wrote:
> 
>> 
>> On May 26, 2012, at 9:34 AM, Andrew Thompson wrote:
>> 
>>> Honestly, I think we probably are at a point where this change makes sense. More than a decade has passed. But at the very least it should *never* *ever* be US ASCII in any shipping build (which would be going backwards from MacRoman) and it really *should* be in the release notes, because this is not a small change, though it is a subtle one. Its fair to make an explicit choice to do this, its not a good idea to do it by accident.
>> 
>> Not sure why you're cross-posting back to java-dev. Hasn't been MRJ for a while has it?
> 
> Well, yes, I have been around for a while. I never updated the local name for the java-dev mailing list. To be honest I was hoping Mike Swingler might confirm or correct what I had to say.
> 
> Speaking of which, I realized I didn't read your original post closely enough.  Running this
> 
>    public static void main(String[] args) {
>        System.out.println(Charset.defaultCharset());
>        Properties p = System.getProperties();
>        for (Object key : p.keySet()) {
>            if ( key.toString().contains(".io") || key.toString().contains("file") || key.toString().contains("encoding")) {
>                System.out.println(key + ": " + p.get(key));
>            }
>        }
>    }
> 
> 
> On Apple's Java 6 on a US system yields
> 
> file.encoding.pkg: sun.io
> java.io.tmpdir: /var/folders/7m/7mim+FSkH-OUDOW+xuAhk++++TM/-Tmp-/
> sun.jnu.encoding: MacRoman
> file.encoding: UTF-8
> file.separator: /
> sun.io.unicode.encoding: UnicodeLittle
> 
> I had been assuming you were referring to file.encoding changing from MacRoman to UTF-8, but clearly it has been UTF-8 for a while.
> Googling around sun.jnu.encoding ... it turns out to be an undocumented property that influences things like parsing the command line.
> Clearly a much less important thing to change. Basically, nothing to see here. Apologies for all the noise.
> 
> AndyT



More information about the macosx-port-dev mailing list