file.encoding vs. sun.jnu.encoding(?) on OS X

Scott Kovatch scott.kovatch at oracle.com
Thu Nov 8 11:25:35 PST 2012


Hello,

I want to bring up something that is causing a lot of confusion, and is generating a lot of bugs on OS X.

What is the relationship between path names and file.encoding? Or, maybe more correctly, _why_ is there some relationship between path names and file.encoding? On OS X filenames are ALWAYS in UTF-8, so the current locale should never come into play.

I was about to launch into a discussion (rant) about our use of nl_langinfo(CODESET) for file.encoding, but the more I look into it, I don't think that's the problem, though you can also make a case that all text files on OS X are UTF-8 by default as well. I'm wondering if this has something to do with sun.jnu.encoding being set to the same value as file.encoding.

-- Scott K.

----------------------------------------
Scott Kovatch
scott.kovatch at oracle.com
Santa Clara/Pleasanton, CA




More information about the jdk8-dev mailing list