Bug 379224 - 'JRE Definition' dialog should allow to specify the encoding
Summary: 'JRE Definition' dialog should allow to specify the encoding
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.8   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Debug-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-11 05:45 EDT by Julia Zhou CLA
Modified: 2012-05-14 21:53 EDT (History)
1 user (show)

See Also:


Attachments
DBCS characters are displayed as garbage code. (42.48 KB, image/png)
2012-05-11 05:47 EDT, Julia Zhou CLA
no flags Details
Test .ee files and screenshots (111.61 KB, application/octet-stream)
2012-05-11 05:49 EDT, Julia Zhou CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julia Zhou CLA 2012-05-11 05:45:25 EDT
Build Identifier: Version: 4.2.0 Build id: I20120315-1300

1. Double-byte and four-byte characters are displayed as garbage code if encoding of the JRE definition file is utf-8
2. DBCS characters could be displayed properly if encoding of the JRE definition file is ANSI
3. As 4-byte GB18030 characters couldn't be saved in an ANSI encoding file, it's needed to use utf-8/unicode encoding file to support 4-byte GB18030 characters.
4. If encoding of the JRE definition file is unicode(utf-16), an error will occurred even if there are only single byte characters in the file.

Reproducible: Always

Steps to Reproduce:
1. Open Eclipse SDK
2. Select from menu Window->Preferences->Java->Installed JREs
3. Click Add button
4. Select Execution Environment Description as JRE Type
5. Click File button to select a utf-8 encoding .ee file that contains GB18030 characters
6. Check characters in the JRE name and Default VM arguments fields
Comment 1 Julia Zhou CLA 2012-05-11 05:47:01 EDT
Created attachment 215454 [details]
DBCS characters are displayed as garbage code.
Comment 2 Julia Zhou CLA 2012-05-11 05:49:32 EDT
Created attachment 215455 [details]
Test .ee files and screenshots
Comment 3 Dani Megert CLA 2012-05-11 08:26:02 EDT
I assume you are on an OS that does not have UTF-8 by default.

We can either use the workspace encoding instead of the platform encoding or do a more complete fix by allowing to specify the encoding of the file.
Comment 4 Dani Megert CLA 2012-05-11 08:28:51 EDT
We should allow to set the encoding. Default should be the workspace encoding.
Comment 5 Julia Zhou CLA 2012-05-14 01:07:35 EDT
(In reply to comment #3)
> I assume you are on an OS that does not have UTF-8 by default.
> 
> We can either use the workspace encoding instead of the platform encoding or do
> a more complete fix by allowing to specify the encoding of the file.

Yes, I used Windows 7(Simplified Chinese) in my test. Default Text encoding is "Default(GB18030)" in Window->Preference->General->Workspace.

I have tried to change local to en-us, Default Text encoding was changed to Cp1252. So, could you kindly let me know how set OS to have UTF-8 by default? Many thank.
Comment 6 Dani Megert CLA 2012-05-14 04:35:34 EDT
(In reply to comment #5)
> (In reply to comment #3)
> > I assume you are on an OS that does not have UTF-8 by default.
> > 
> > We can either use the workspace encoding instead of the platform encoding or do
> > a more complete fix by allowing to specify the encoding of the file.
> 
> Yes, I used Windows 7(Simplified Chinese) in my test. Default Text encoding is
> "Default(GB18030)" in Window->Preference->General->Workspace.
> 
> I have tried to change local to en-us, Default Text encoding was changed to
> Cp1252. So, could you kindly let me know how set OS to have UTF-8 by default?
> Many thank.

AFAIK you can't change the encoding that Windows picks for each locale.
Comment 7 Dani Megert CLA 2012-05-14 16:40:08 EDT
The usual scenario is to select a file that has been crafted in your OS. Using a file from a different OS with a different encoding is not common and so far no one has ever requested to support this.

We have no plans to work in this in the near future.
Comment 8 Julia Zhou CLA 2012-05-14 21:53:28 EDT
(In reply to comment #6)
> AFAIK you can't change the encoding that Windows picks for each locale.

Thank you, Dani.

I have tried to use gb18030(default encoding) as encoding of .ee file, it works fine for all GB18030 characters. So, this bug will not block GB18030 testing.