United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8003228 (props) sun.jnu.encoding should be set to UTF-8 [macosx]
JDK-8003228 : (props) sun.jnu.encoding should be set to UTF-8 [macosx]

Details
Type:
Bug
Submit Date:
2012-11-09
Status:
Closed
Updated Date:
2013-05-28
Project Name:
JDK
Resolved Date:
2013-04-01
Component:
core-libs
OS:
Sub-Component:
java.lang
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
Fixed Versions:
8

Related Reports
Backport:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Duplicate:
Relates:
Relates:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

Description
sun.jnu.encoding is the encoding used for encoding/decoding file paths and is defaulting to the value of file.encoding on Mac. It has been suggested that this should be changed to always be UTF-8. Before doing that we require some technical reference to ensure that this is the right thing to do.
                                    

Comments
See thread at:
http://mail.openjdk.java.net/pipermail/jdk8-dev/2012-November/001609.html

The main thing we need is an authoritative reference that confirms that sun.jnu.encoding should be fixed as UTF-8 on Mac.
                                     
2012-11-14
This technical Q&A from Apple:
http://developer.apple.com/library/mac/#qa/qa1173/_index.html
states:

"The lowest levels of Mac OS X...treat file names as UTF-8 encoded Unicode strings."

                                     
2012-11-29
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/dbc692ea3f0a
User:  naoto
Date:  2013-01-07 21:19:49 +0000

                                     
2013-01-07
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/dbc692ea3f0a
User:  lana
Date:  2013-01-15 19:00:22 +0000

                                     
2013-01-15
CAP member had reported the same issue and would like the fix backported to 7u release as well.
                                     
2013-03-14
CAP member had tried on the latest JDK 8 build(b81), but the file.encoding was still set to US_ASCII, does not seem the problem had been fixed.
                                     
2013-03-27
More information from CAP member -

Running from the cmdline actually gives the system property "file.encoding" a working value of "UTF-8" and not "US_ASCII" as double clicking the jar file.

to reproudce the problem, just make an executable jar file that prints the value of the system property "file.encoding". It should not be "US_ASCII" as that disables the use of accented characters in file names.

jAlbum is developed by using Netbeans. 

jAlbum isn't launched via webstart.It can be workarounded by explicitly passing -Dfile.encoding=UTF-8 as a startup parameter, but it is still better if this bug is fixed instead (there may always be users who miss such startup parameters for instance)
                                     
2013-04-01
I have reproduced the problem described by the CAP member.  However, the issue is with the "file.encoding" property, and this bug was meant only to cover "sun.jnu.encoding", which it has, so I'm closing this issue.

I have filed a new issues to cover the problem of file.encoding when launching apps on Mac via double-clicked .jar (JDK-8011194) or via webstart (JDK-8011195).

                                     
2013-04-01
verified in b85
                                     
2013-04-12



Hardware and Software, Engineered to Work Together