Community
Participate
Working Groups
My system is win2k,locale China,if I set text file encoding to GBK, then the java file displays "Character encoding GBK is not supported by this platform". If I set it to UTF-8, the source window is ok ,but some error message in console windows sometimes contains Chinese characters, will not be displayed correctly.
In another system this problem doesn't occur, but I can't find any difference between them. Both system are Win2k, locale Chinese,jdk 1.4.0(system jre 1.3.1,while Eclipse JRE 1.4.0).
the error message in log: !SESSION Jul 04, 2002 14:18:02.254 --------------------------------------------- java.version=1.3.1 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=zh_CN Command-line arguments: -os win32 -ws win32 -arch x86 -data e:\work\workspace - install file:D:/app/Eclipse/ !ENTRY org.eclipse.jdt.ui 4 1 Jul 04, 2002 14:18:02.254 !MESSAGE Internal Error !STACK 1 org.eclipse.jdt.core.JavaModelException[985]: java.io.UnsupportedEncodingException: GBK at sun.io.Converters.getConverterClass(Unknown Source) at sun.io.Converters.newConverter(Unknown Source) at sun.io.ByteToCharConverter.getConverter(Unknown Source) at java.io.InputStreamReader.<init>(Unknown Source) at org.eclipse.jdt.internal.compiler.util.Util.getInputStreamAsCharArray (Util.java:242) at org.eclipse.jdt.internal.core.Util.getResourceContentsAsCharArray (Util.java:502) at org.eclipse.jdt.internal.core.CompilationUnit.openBuffer (CompilationUnit.java:757) at org.eclipse.jdt.internal.core.Openable.openWhenClosed (Openable.java:401) at org.eclipse.jdt.internal.core.JavaElement.openHierarchy (JavaElement.java:521) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo (JavaElement.java:308) at org.eclipse.jdt.internal.core.JavaElement.getChildren (JavaElement.java:264) at org.eclipse.jdt.internal.core.JavaElement.getChildrenOfType (JavaElement.java:273) at org.eclipse.jdt.internal.core.CompilationUnit.getTypes (CompilationUnit.java:567) at org.eclipse.jdt.internal.ui.util.OpenTypeHierarchyUtil.getCandidates (OpenTypeHierarchyUtil.java:234) at org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.getCandidates (OpenTypeHierarchyAction.java:87) at org.eclipse.jdt.ui.actions.OpenTypeHierarchyAction.selectionChanged (OpenTypeHierarchyAction.java:81) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchSelectionChanged (SelectionDispatchAction.java:187) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.selectionChanged (SelectionDispatchAction.java:182) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged (Viewer.java:147) at org.eclipse.jface.viewers.StructuredViewer.updateSelection (StructuredViewer.java:1155) at org.eclipse.jface.viewers.StructuredViewer.handleSelect (StructuredViewer.java:544) at org.eclipse.jface.viewers.StructuredViewer$1.widgetSelected (StructuredViewer.java:568) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent (OpenStrategy.java:171) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:168) at org.eclipse.jface.util.OpenStrategy$1.handleEvent (OpenStrategy.java:297) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:77) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:827) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1529) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1291) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1177) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1160) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:775) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:248) at org.eclipse.core.launcher.Main.run(Main.java:698) at org.eclipse.core.launcher.Main.main(Main.java:534)
Nick, can you please comment on that. Is there an additional library needed to get GBK encoding ?
The log indicates that Eclipse is running on jdk 1.3.1. Perhaps 1.4 has the GBK encoding, but 1.3.1 does not.
Was GBK avaialble as one of the encoding options from the file encoding menu or did you specify it as a run time parameter? Using a Chinese XP machine with GB18030 installed GBK did not come up as one of the options.
I have just tried this on an XP Chinese machine with GB18030 installed using the 1.3.1. VM by typing "GBK" into the text encoding combo box on the preference page. This worked just fine. I think we need more specifics on what machine this is occuring on including OS Locale VM version and vendor How it was launched Where GBK is being specified
I removed jre1.3.1,reinstalled 1.4.0,now it's OK. It seemed that if system jre is 1.3.1,Eclipse will use 1.3.1 even I specified 1.4 in preference. I specified GBK at preference,workbench,editor,text file encoding,where GBK is default.
GBK has been added for Chinese locales for 2.1. To be released when the fix for Bug 22016 is approved.
as stated in comment 7
I have seen this bug when running an app that only had the JRE installed. After we installed the SDK (jdk1.6.0_20), the application ran fine...
(In reply to comment #10) > I have seen this bug when running an app that only had the JRE installed. After > we installed the SDK (jdk1.6.0_20), the application ran fine... I don't think it depends on whether you use the JRE or SDK if it's the same version.