This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 252542 - add -J-Dfile.encoding=UTF-8 to netbeans_default_options parameter in netbeans.conf to fix unicode problem on windows systems.
Summary: add -J-Dfile.encoding=UTF-8 to netbeans_default_options parameter in netbeans...
Alias: None
Product: platform
Classification: Unclassified
Component: Data Systems (show other bugs)
Version: 8.0.2
Hardware: PC All
: P3 normal with 2 votes (vote)
Assignee: Jaroslav Havlin
Depends on:
Reported: 2015-05-22 06:31 UTC by ravshansbox
Modified: 2015-11-14 10:03 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description ravshansbox 2015-05-22 06:31:08 UTC

Comment 1 Antonin Nebuzelsky 2015-07-13 12:15:46 UTC
Enforcing this encoding setting for all users does not sound right.

What is exactly the problem to be resolved?
Comment 2 cezariusz 2015-07-13 20:58:26 UTC
I will give you an example. I have a platform application which requires to run with UTF (because a third-party library always uses UTF-8). So I added "-J-Dfile.encoding=UTF-8" to the But then when I started the application, all logs in the console output were corrupted because of the encoding differences. So I had to manually add -J-Dfile.encoding=UTF-8 to netbeans_default_options parameter in the netbeans.conf file, and I have to repeat this for each daily build. And all other developers working on Windows have to this as well.
Comment 3 Tomas Zezula 2015-07-14 16:21:06 UTC
In fact the correct way how to solve the problem is to use FileEncodingQuery.
In Ant Based J2SE (WEB, J2EE) Projects it's done by source.encoding property.
When source.encoding is set the IDE runs the app with the encoding and configures the output to use the encoding.
I am not sure if the same property is used by harness project, I will try to find.
Comment 4 ravshansbox 2015-09-04 05:07:03 UTC
In fact it's problem of JRE/JDK that it uses platform default encoding instead of setting it to a more modern one (still hoping that JDK9 may solve the problem in future), but still there is a way to help all developers who uses windows working around this problem.
Comment 5 ravshansbox 2015-11-14 10:03:29 UTC
I could work around this bug by setting environment variables: JAVA_OPTS, MAVEN_OPTS and JAVA_TOOL_OPTIONS to include "-Dfile.encoding=UTF-8".