| Summary: | BIDI - Eclipse generates an exception when trying to save in UTF-8 Arabic locale | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Nagia El Haraki <nharaki> |
| Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | daniel_megert, rasham |
| Version: | 2.1 | ||
| Target Milestone: | 3.2 | ||
| Hardware: | PC | ||
| OS: | Linux-GTK | ||
| Whiteboard: | |||
|
Description
Nagia El Haraki
The log is not directly related to save - it rather looks as being caused by changing the selection. Can you list the exact steps and then first clear the .log and try the steps you listed here. Also attach the ID of the build you are using. Here is my guess what happens: You view a compilation unit in an encoding that is different from the workbench's default encoding. You change the compilation unit. You save the compilation unit and the save operation succeeds. This means the cu is now saved in the same encoding that has been used for viewing it and that is different from the workbench's default encoding. Cause by an event, the Java compiler tries to read the compilation unit from its file. The compiler uses the workbench's default encoding for that. As the file has been saved in a different encoding before, the read operation files with a MalFormedInputException. When saving the compilation unit, the user has been notified that subsequent operation on this file might file because of the difference between the workbench's default encoding and the encoding used for saving the file. This is a shortcoming of the current implementation which will be revisited during the 3.0 cycle. What happened was that I already had the files written and saved under the specific encoding (whether Cp1256 or ISO-8859-6). When I open them from Eclipse (Arabic locale, UTF-8), it is not recognized. So, I go to Edit>Encoding and change it to the file's encoding. When I modify the file and attempt to save it, that's when the given exception occurs. It gives me first a warning that the file will saved under an encoding different than the default encoding, and when I proceed it gives the exception. This means that if I am going to write my application under that specific encoding from scratch, it is not going to be saved. . Eclipse now shows a dialog when trying to save with an inappropriate encoding. |