| Summary: | [resources] Resources names in file system are not i18n (file.encoding problem) | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | mobilae <studnev> | ||||
| Component: | Resources | Assignee: | DJ Houghton <dj.houghton> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipse, zvonov | ||||
| Version: | 2.0.1 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 2000 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
mobilae
Created attachment 3121 [details]
Workspace, file system and project properties
Additional investigation showed that it happens when default language does not correspond computer locale. Defaulkt language effects in file.encoding JVM property. If you try create resources NOT in file.encoding codepage Eclipse convert characters and that is bad. Seems like Eclipse creates file names not in UTF8? More precisely:
When some strings collected by eclipse is going to be filenames, they are
transformed into byte arrays with String.getBytes() or so. This getBytes() uses
default encoding, set in file.encoding property. This property is set by JVM on
startup to current windows locale. It is usually non-UNICODE encoding (such as
Cp1251).
Eclipse should depending on underlying OS use UNICODE-encoding where possible
(UTF-8, UTF-16, USC-2...) (I dont quite remember which one is to be used in
Windows 2000/XP). So you need to use getBytes("UTF-16") or so everywhere in
output to filesystem.
Could you please inform which Eclipse build and JRE provider/version you are using? Some VMs do not handle file names containing characters not supported in the default encoding properly on Windows 2K/XP. Eclipse uses the core Java APIs and native calls for creating file/folders and listing directory contents. 1.4 level VMs seem to support files containing any Unicode characters properly (if the OS provides support). However, before build 20030205, Eclipse didn't handle those files properly even when running on 1.4 level VMs (see bug 13163). Could you try this build with a 1.4-level VM to see if the problem persists? Thanks. We are using Sun java 1.3.1_06. Sorry but we NEED it to work on 1.3.1 (as soon as eclipse declares 1.3 support and we rely on this declaration in our work). And this problem certanly can be fixed by eclipse developers. Look my previous comment and just fix one string in your java code. Forget to give you eclipse build: we are using eclipse 2.0.1 release (build 200208291828) Denis, we don't do any encoding when creating files and folders, we just call the standard Java I/O API passing Java strings (which are Unicode). So, although Eclipse supports 1.3 level JREs, we cannot overcome all bugs in the underlying JRE that avoid Eclipse of working properly. The good news is that this bug seems to be fixed in the new Sun JRE 1.3.1_07. From JavaSoft's bug parade: java.io: Cannot create files with full Unicode names (Win32/NT) http://developer.java.sun.com/developer/bugParade/bugs/4185525.html Please let us know if the problem goes away using the new VM. I could verify that Sun JDK/JRE 1.3.1_07 seems to effectively fix the problem. By the way, the bug I intended to refer to before (see comment 4) was actually bug 13463 (whose fix now works also on this new JRE). DJ, I suggest this bug to be closed as works-for-me. Closing. |