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 163697 - i18n - cannot use utf-8 encoding in none english locale on windows
Summary: i18n - cannot use utf-8 encoding in none english locale on windows
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords: I18N
: 164427 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-04-26 22:42 UTC by mvanek
Modified: 2009-05-11 11:39 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
messages log (42.86 KB, text/plain)
2009-04-26 22:45 UTC, mvanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mvanek 2009-04-26 22:42:55 UTC
I am running NB on win XP in Japanese locale.
If I try to input japanese characters into editor and run a file, building file fails. 
The project encoding is set to UTF-8.
got this error:
あAAA始run:んZZZ終
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
        at javaapplication9.Main.main(Main.java:19)
Java Result: 1
あAAA始BUILD SUCCESSFUL (total time: 5 seconds)んZZZ終


If I switch project encoding to windows31j and do the same process, file is successfully compiled. 
Using mbytes in UTF-8 worked in versions NB6.5.1 and M3
Comment 1 mvanek 2009-04-26 22:45:28 UTC
Created attachment 80945 [details]
messages log
Comment 2 Jiri Prox 2009-04-27 11:15:42 UTC
What is code at line Mina:19 ? 
Comment 3 mvanek 2009-04-27 11:23:35 UTC
line 19: System.out.println(".んZZZ終");
Comment 4 mvanek 2009-04-27 11:30:09 UTC
More description about behaviour:

I created a new java project and put System.out.println(".んZZZ終"); to
main.java class.
The build fails. After that I restarted NB and tried to run file again.
The build is successful and the text is printed to output window.

If I create a new class with mbytes and then try to print some mbytes,
error appears. After NB restart it is still there.

あAAA始run:んZZZ終
java.lang.NoClassDefFoundError: javaapplication9/スイテテイス
Caused by: java.lang.ClassNotFoundException: javaapplication9.スイテテイス
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: javaapplication9.スイテテイス.  Program will exit.
Exception in thread "main" Java Result: 1
あAAA始BUILD SUCCESSFUL (total time: 1 second)んZZZ終
Comment 5 Vitezslav Stejskal 2009-05-04 11:56:48 UTC
Does your project use Compile On Save? This could be related to issue #121727.
Comment 6 ecastro 2009-05-05 07:50:38 UTC
I tried the procedure described here on a Windows XP French edition (the standard CP1252 encoding).
Yes, the fault is (at least) to the Compile On Save.
When I remove it, mo more encoding problems occurs with Java file contents nor Java file names while compiling.

However, with exotic Java file names, the IDE still report errors (I guess it uses the same mechanism than
Compile On Save).

Futhermore, it breaks the renaming of class names in Refactoring.

And I don't think it is related to issue #121727.
There is no encoding changes, and it happens even if one trashed the /var/cache 


Now, I am sure that my issue 164427 is a duplicate of this.
Comment 7 mvanek 2009-05-05 08:31:54 UTC
VStejskal: I am using compile on save. 
Comment 8 Dusan Balek 2009-05-05 10:36:57 UTC
Fixed in jet-main.

http://hg.netbeans.org/jet-main/rev/5f1b743c8f7f
Comment 9 Quality Engineering 2009-05-07 07:49:07 UTC
Integrated into 'main-golden', will be available in build *200905070201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/5f1b743c8f7f
User: Dusan Balek <dbalek@netbeans.org>
Log: Issue #163697: cannot use utf-8 encoding in none english locale - fixed.
Comment 10 Jan Jancura 2009-05-11 11:39:57 UTC
*** Issue 164427 has been marked as a duplicate of this issue. ***