Community
Participate
Working Groups
OS: Windows2003 Standard Edition Language: Japanese Build level: wswb-I20040413-200404191247 JDK Version: IBM JDK 1.4.2 Beta Test case #: Description: Steps to recreate problem: 1-create java program on RHEL 3.0WS Japanese locale (workbench default encoding is EUC-JP). 2-create java project on windows2003 (workench default encoding is MS932), and change EUC-JP at the project properties > info page 3-import the java programs into the project 4-edit a text in comment, and save 5-compare from local history <<error>> bogus all of Japanese text in the file at local history and they are indicated as changed.
Created attachment 9697 [details] sample java programs
Created attachment 9698 [details] screen shot
Moving to Platform/Compare. Please try opening bugs against the specific component.
The problem is that FileState.getCharset() returns null in this case. I suggest to return the getCharset() of the associated IFile. Moving to platform.core
Andre, I would say that when someone calls IFileState#getCharset, that information should be extracted from the state itself, and not default to the corresponding file's charset. We already have bug 61986 (the one this depends on) for the issue with states not remembering their charsets at the time they were created. Even when that one is fixed, I would not expect the corresponding file to be queried anyway. Isn't there anything you can do on your side to work around bug 61986? For instance, you could do the same thing you suggested (default to the corresponding file's charset), or allow the user to manually select a different charset to use when reading a given state. If it cannot be worked around, feel free to mark this one as a duplicate of bug 61986. Moving back (again!) to Compare for comments/further action.
I had the impression that delegating the IFileState.getCharset request to the IFile would be a better approximation of the desired behavior than the current implementation. Yes, I can try to workaround this problem in my code (and all other clients need to do the same).
fixed for RC2
verified in 3.0 and closing