| Summary: | "Text editor" and "Property editor" could display Chinese characters correctly | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | zhoutao <moonese> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | CLOSED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 3.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
| Attachments: | |||
|
Description
zhoutao
Created attachment 22584 [details]
a sample property file that containing chinese characters
a sample property file that containing chinese characters
Created attachment 22585 [details]
the display in my machine
above is the original text,
below is what it is displayed in property editor,
You gave to install Chinese otherwise this won't work in Windows2000. On WinXP you can simply add the additional input languages and fonts. I do have installed chinese input language, 'cause in windows explorer, all chinese filenames could be displayed, and also i have input chinese input languages, just as i mentioned, JDT's Java Editor just could display chinese characters correctly in the same machine. but neithor "Text Editor" nor "Property Editor" could work Created attachment 22587 [details]
Regional Options Setting in Control Panel
Regional Options Setting in Control Panel
Check whether they use the same font as the Java editor. Created attachment 22590 [details]
JAVA editor and Properties text font setting,
JAVA editor and Properties text font setting, which is same to text editor's
font setting
Created attachment 22591 [details]
Text editor's font setting
Text editor's font setting, which is GBK,
if text editor does use this setting - *GBK*,
it will be OK to display Chinese character.
I also changed to UTF-8, UTF-16, etc, but also could not work
OK, I now see what happens. It's about the *encoding* not the font. If you create new properties, Java or text files they get the content types default encoding: *.properties files: ISO-8859-1 *.java: non / platform default so, it's not about the editor but about what encoding is used. Try this: create a file in the Java editor which looks good, save and open with either the Text or Properties edtior. Created attachment 22592 [details]
the properties file in hex string
another thing i just noticed is:
the file containing Chinese Characters in the properties file which I created
outside Eclipse could not display correctly,
but when I input Chinese characters in the *Property Editor*,
Chinese Character could be inputed also displayed OK, without any problem,
but when I close the file in Eclipse, and open again,
the place which would be chinese characters were replaced by two "??",
the attached is the hex string of the file after I saved.
So, it seems that when the file is saved,
some encoding conversion has been done to it, but failed to convert to the
corrent encode.
I just quite puzzled why in Java Editor, no this problem.
I can input Chinese Characters, save, open, all fine.
Hi, Daniel Megert: I just input some chinese characters inside the .java file, close it, then open with text editor, OK, no problem, the characters I input could be displayed OK. vice verse, I create a new text in the Eclipse environment, by New-> Simple -> Untitled Text File, input some Chinese Characters, save to disk, close, open, also OK, no problem. But if the file was created outside Eclipse beforehand, It will failed by the same operation. you right, its an encoding problem, The problem is that if the encoding can't be determined from the file the default is used: select the file in the Navigator or Package Exlporer and see what encoding is used. *.properties files have ISO-8859-1 encoding per default and hence you can't type in special chars. You can change this by changing the default encoding for the properties file content type but that's not recommended since Java properties files are speced to have ISO-8859-1 encoding. Note that you can also set the default encoding on folders and files but that changing the encodign *does not* convert existing files. OK. i see. |