Bug 13591 - GB18030: Could not open a Unicode encoding file with Text Editor
Summary: GB18030: Could not open a Unicode encoding file with Text Editor
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 9052 9069 14435
Blocks:
  Show dependency tree
 
Reported: 2002-04-12 03:49 EDT by Yue Ma CLA
Modified: 2003-01-23 02:56 EST (History)
0 users

See Also:


Attachments
XML file (4.01 KB, text/plain)
2002-04-12 07:40 EDT, Yue Ma CLA
no flags Details
error message (2.99 KB, text/plain)
2002-04-12 07:41 EDT, Yue Ma CLA
no flags Details
Screen Cut of the step 3 (49.61 KB, image/jpeg)
2002-04-12 07:44 EDT, Yue Ma CLA
no flags Details
Screen Cut of the step 4 (51.70 KB, image/jpeg)
2002-04-12 07:45 EDT, Yue Ma CLA
no flags Details
Error message metioned in comment #17 (36.07 KB, image/pjpeg)
2003-01-23 02:56 EST, Liu Yang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yue Ma CLA 2002-04-12 03:49:36 EDT
OS: Windows2000 Simplified Chinese Version + GB18030 Patch
Eclipse Build: 20020321 Stable Build
Java Version: J2RE 1.4.0 IBM Windows 32 build cndev-20020405 (JIT enabled: jitc)
(Beta)

Couldn't use Text Editor in Eclipse to open an unicode-encoding xml file
(created by Cam-thu le)which contains some GB18030 character.
 
Re-produce Steps:
1. Import the welcome.xml to a project.
3. Right Click welcome.xml->open with->Text Editor(xml7.jpg)
4. An error windows pops up(xml8.jpg)
7. A detail error message in detail(xmlerr.txt)
Comment 1 DJ Houghton CLA 2002-04-12 07:17:43 EDT
Could you please attach the referenced error texts/pics? Thanks.
Comment 2 Yue Ma CLA 2002-04-12 07:40:17 EDT
Created attachment 585 [details]
XML file
Comment 3 Yue Ma CLA 2002-04-12 07:41:54 EDT
Created attachment 586 [details]
error message
Comment 4 Yue Ma CLA 2002-04-12 07:44:41 EDT
Created attachment 587 [details]
Screen Cut of the step 3
Comment 5 Yue Ma CLA 2002-04-12 07:45:55 EDT
Created attachment 588 [details]
Screen Cut of the step 4
Comment 6 John Arthorne CLA 2002-04-12 10:12:00 EDT
The stack trace shows that an error occurs creating the document for the editor. 
 A second error then occurs because StorageDocumentProvider tries to create a 
Status with a null plug-in ID (see bug 9052).  The cause of the original error 
is unknown.

Moving this one to UI.
Comment 7 Tod Creasey CLA 2002-04-12 10:27:50 EDT
When I open it on a GB18030 compliant VM (Sun JDK 1.4) it opens without an 
error but the characters are shown in correctly encoded.

It is possible to paste the correct characters back in, save and reopen but 
then they show up as a series of ?.

Please note that not all GB18030 characters have a unicode mapping - this may 
be bigger than the simple unicode problem. However it may be related to Bug 
9069 so I have added it to the dependancy list.
Comment 8 Tod Creasey CLA 2002-04-15 13:44:42 EDT
Note that this is also te behaviour in Notepad which gives me a warning about 
saving with GB 18030 characters.
Comment 9 Tod Creasey CLA 2002-04-15 15:16:24 EDT
In the Hursley 1.3.1 VM in build 20020411 if you enter the characters 
༃༄༅༆༇༈ into the welcome.xml and then save anb reopen the characters come 
back correctly and there are no errors.

The initial entry does not show the characters  but I am not sure how this file 
was saved.
Comment 10 Yue Ma CLA 2002-04-23 01:28:44 EDT
I use the WordPad of the Windows to edit the welcome.xml. After input some 
GB18030 character into the file, I saved it as a Unicode Encoding file-
welcome.txt and then I rename the txt to xml. After that I replace the 
welcome.xml in the eclipse SDK. The welcome page displays well when I start up 
the Eclipse. 

But I got an internal error when I tried to open it with Text editor in 
Eclipse after I had imported the welcome.xml into a project.
Comment 11 Tod Creasey CLA 2002-04-23 11:43:06 EDT
Reopening to investigate new information
Comment 12 Tod Creasey CLA 2002-04-23 12:51:28 EDT
I can replicate the incorrect characters but not the Internal Error in build 
0418. Can you still get the Internal Error on 20020418?
Comment 13 Tod Creasey CLA 2002-04-23 13:01:41 EDT
Logged Bug 14335 for the read/write problem.
Comment 14 Tod Creasey CLA 2002-04-23 13:02:22 EDT
Should have been Bug 14435.
Comment 15 Yue Ma CLA 2002-04-24 03:18:27 EDT
OS: Windows2000 Simplified Chinese Version + GB18030 Patch
Eclipse Build: 20020418
Java Version: J2RE 1.3.1 IBM Windows 32 build cn131-20020403 (JIT enabled: 
jitc)

I still get the internal error in build 0418:
java.lang.IllegalArgumentException: 
	at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:50)
	at org.eclipse.core.internal.runtime.Assert.isLegal(Assert.java:35)
	at org.eclipse.core.runtime.Status.setPlugin(Status.java:151)
	at org.eclipse.core.runtime.Status.<init>(Status.java:59)
	at 
org.eclipse.ui.editors.text.StorageDocumentProvider.setDocumentContent
(StorageDocumentProvider.java:83)
	at org.eclipse.ui.editors.text.FileDocumentProvider.setDocumentContent
(FileDocumentProvider.java:213)
	at org.eclipse.ui.editors.text.StorageDocumentProvider.createDocument
(StorageDocumentProvider.java:126)
	at org.eclipse.ui.editors.text.FileDocumentProvider.createElementInfo
(FileDocumentProvider.java:368)
	at org.eclipse.ui.texteditor.AbstractDocumentProvider.connect
(AbstractDocumentProvider.java:247)
	at org.eclipse.ui.texteditor.AbstractTextEditor.doSetInput
(AbstractTextEditor.java:1503)
	at org.eclipse.ui.texteditor.AbstractTextEditor.init
(AbstractTextEditor.java:1146)
	at org.eclipse.ui.internal.EditorManager.createSite
(EditorManager.java:485)
	at org.eclipse.ui.internal.EditorManager.access$1
(EditorManager.java:483)
	at org.eclipse.ui.internal.EditorManager$2.run(EditorManager.java:467)
	at org.eclipse.swt.custom.BusyIndicator.showWhile
(BusyIndicator.java:56)
	at org.eclipse.ui.internal.EditorManager.openInternalEditor
(EditorManager.java:460)
	at org.eclipse.ui.internal.EditorManager.openInternalEditor
(EditorManager.java:529)
	at org.eclipse.ui.internal.EditorManager.openEditor
(EditorManager.java:361)
	at org.eclipse.ui.internal.EditorManager.openEditor
(EditorManager.java:264)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:1586)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor
(WorkbenchPage.java:1487)
	at org.eclipse.ui.actions.OpenWithMenu.openEditor
(OpenWithMenu.java:228)
	at org.eclipse.ui.actions.OpenWithMenu.access$0(OpenWithMenu.java:222)
	at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent
(OpenWithMenu.java:149)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java
(Compiled Code))
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java
(Compiled Code))
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java
(Compiled Code))
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java
(Compiled Code))
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:833)
	at org.eclipse.ui.internal.Workbench.run(Workbench.java:816)
	at org.eclipse.core.internal.boot.InternalBootLoader.run
(InternalBootLoader.java:643)
	at org.eclipse.core.boot.BootLoader.run(BootLoader.java:349)
	at java.lang.reflect.Method.invoke(Native Method)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:195)
	at org.eclipse.core.launcher.Main.run(Main.java:541)
	at org.eclipse.core.launcher.Main.main(Main.java:396)
Comment 16 Tod Creasey CLA 2002-05-16 13:38:51 EDT
Works in build 20020515.

Please note that workbench.xml specifies that it is in UTF 8 in the xml 
declaration. If not save it in an encoding otehr than UTF8 there is no 
guarantee that it would work.

However I tried both unicode and UTF8 versions of the file and both work in 
20020515. The characrters will npt disaply unless you have the banner font set 
to a GB18030 compliant font.
Comment 17 Liu Yang CLA 2003-01-23 02:54:11 EST
Verify with following test environment: 

Eclipse Build: 20021218 Stable Build (bug occured)
JRE version: J2RE 1.3.1 IBM Windows 32 build cn140-20020902 (JIT enabled: jitc)
Result: Could not read unicode file, but no internal error message.(see 
Attachment below)

Eclipse Build: 20021218 Stable Build (bug occured)
JRE version: J2RE 1.4.0 IBM Windows 32 build cn140-20020902 (JIT enabled: jitc)
Result: Could not read unicode file, but no internal error message.(see 
Attachment below)
Comment 18 Liu Yang CLA 2003-01-23 02:56:20 EST
Created attachment 3093 [details]
Error message metioned in comment #17