Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 385305 - BDL IES3.8: Hebrew is mocked after encoding change
Summary: BDL IES3.8: Hebrew is mocked after encoding change
Status: RESOLVED DUPLICATE of bug 179187
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 4.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-17 09:14 EDT by Gregory Brodsky CLA
Modified: 2012-07-19 09:33 EDT (History)
7 users (show)

See Also:


Attachments
screenshot (195.03 KB, image/jpeg)
2012-07-17 09:19 EDT, Gregory Brodsky CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Brodsky CLA 2012-07-17 09:14:39 EDT
Build Identifier: Version: 4.2.1 Buid id: J20120711-1640

By default, workspace encoding inherits system settings and is set into cp1255 for Hebrew. However some functionality requires UTF-8 for proper work. After change the encoding, Hebrew is mocked in existing Java files. 

The problem was found with Java Servlets, but I believe it exists with other kind of source files.

Reproducible: Always

Steps to Reproduce:
1. Start Eclipse for J2EE on Windows with Hebrew locale
2. Create dynamic Web project
3. Create a servlet, give package name and the servlet name in Hebrew. The source file will contain some Hebrew - the package name, @WebServlet tag etc.
4. Go to Windows->Preferences and change the workspace encoding from 1255 to UTF-8

Result: Hebrew is replaced with rubbish characters.
Comment 1 Gregory Brodsky CLA 2012-07-17 09:19:54 EDT
Created attachment 218802 [details]
screenshot
Comment 2 Paul Webster CLA 2012-07-17 12:58:34 EDT
Switching encoding doesn't "convert" the binary characters in your file from one type to another, so you still have cp1255 binary chars in a file that you want read as UTF-8, and they're invalid ... I think that's what's going on.

PW
Comment 3 Dani Megert CLA 2012-07-18 02:26:40 EDT
(In reply to comment #2)
> Switching encoding doesn't "convert" the binary characters in your file from
> one type to another, so you still have cp1255 binary chars in a file that you
> want read as UTF-8, and they're invalid ... I think that's what's going on.
Correct.

You have to set the encoding *before* you create a file.

Also note, that it is recommended to set the encoding on the project instead of the workspace. This makes sharing the project easier.
Comment 4 Markus Keller CLA 2012-07-19 09:33:38 EDT

*** This bug has been marked as a duplicate of bug 179187 ***