Community
Participate
Working Groups
The character of UTF-8 (Ex> Japanese) in .log file is not correctly displayed by Web browser. In org.eclipse.ui.workbench plug-in package: org.eclipse.ui.internal.dialogs Class: AboutSystemDialog Method: makeDisplayCopy (line=263) It is a cause to use FileReader & FileWriter by the copy processing of .log file. It is necessary to use FileInputStream & FileOutputStream.
Not sure where to punt this...
I don't understand the problem description. Are you saying there are characteres in the .log file that don't display correctly (appear as garbage characters) when you open that file in a web browser? Can you provide a screen capture of the problem?
Created attachment 28973 [details] Screen Shot IE - view .metadata/org.eclipse.ui.workbench/log Notepad - view .metadata/.log And, dump .metadata/org.eclipse.ui.workbench/log & .metadata/.log
Created attachment 28974 [details] screenshot re-upload
What character (the unicode for it and a screen shot so we know what it looks like) should be displayed? There is also the possibility that a translated file may not be correct. But first I need to track the string down. Can you tell me what that message should say in English (roughly)? Generally things that appear in the .log file are not translated (but it could be that same message appears elsewhere, in which case it being translated is ok).
The problem occurs by MBCS 8142. This character is a Japanese punctuation. It is English ".". Please refer to the sample code. It becomes a different code when using FileReader. 1) Result MBCS: ffffff81 42 Java char: 3002 UTF-8: ffffffe3 ffffff80 ffffff82 FileInputStream: ffffffe3 ffffff80 ffffff82 byte to char: 3002 FileReader: 7e32 2) Sample code import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileReader; public class sample { public sample() { } private static void dump(String name, byte[] buf, int len) { System.out.print(name + ":"); for(int i=0; i<len; i++) { System.out.print(" " + Integer.toHexString((int)buf [i])); } System.out.println(""); } private static void dump(String name, char[] buf, int len) { System.out.print(name + ":"); for(int i=0; i<len; i++) { System.out.print(" " + Integer.toHexString((int)buf [i])); } //System.out.print(" "); //for(int i=0; i<len; i++) { // System.out.print(buf[i]); //} System.out.println(""); } public static void main(String[] args) { FileOutputStream fos; try { byte[] buf = new byte[2]; // set MBCS 0x8142 buf[0]=(byte)0x81; buf[1]=(byte)0x42; dump("MBCS", buf, buf.length); String str = new String(buf); char[] chr = str.toCharArray(); dump("Java char", chr, chr.length); buf = str.getBytes("UTF-8"); dump("UTF-8", buf, buf.length); fos = new FileOutputStream("sample.txt"); fos.write(buf); fos.close(); buf = new byte[256]; int len; FileInputStream fis = new FileInputStream ("sample.txt"); len = fis.read(buf); dump("FileInputStream", buf, len); fis.close(); str = new String(buf,"UTF-8"); chr = str.toCharArray(); dump("byte to char", chr, 1); chr = new char[256]; FileReader fr = new FileReader("sample.txt"); len = fr.read(chr); dump("FileReader", chr, len); fr.close(); } catch (Exception e) { e.printStackTrace(); } } }
Are there any incorrect characters in the about system configuration dialog? I can't justify changing the code in the about system dialog without being able to demonstrate an example of the problem. Incorrect characters written to the .log file fall under runtime's jurisdiction, so a separate bug should be logged for that case. Also note that the error log is not intended to have translated messages appear in it. Though I can see how this happens if a message is re-used or translated when it should not have been.
Is this a difference between the file .metadata/.log and the file we use internally for the "View Error Log" button in the About dialog?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.