Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 57559

Summary: DBCS: Cannot display some Korean glyphs on Linux
Product: [Eclipse Project] Platform Reporter: leading <wswb0922>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P2 CC: Tod_Creasey, ycpeng
Version: 3.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard:
Attachments:
Description Flags
the picture of err code.
none
Testdata--dialogs.zip
none
refer the image file for the result. none

Description leading CLA 2004-04-06 07:37:12 EDT
Reporter: Tony Liu
OS: RHEL WS 3.0 -gtk
Language: KOR
Build level: wswb-30M8-200403291703
JDK Version: IBM JDK 1.4.2 Beta
Test case #: UI10:Wizards with DBCS 
Summary: DBCS:Error code show in the Runtime workbench when great wizards with 
DBCS.
Description:
Steps to recreate problem:
1-Imported  the "com.ibm.wsweducation.solution.dialogs"  projects.
2-Change the each of the key values in the "test.properties" file  to DBCS 
data's Unicode.
3-Run the plug-in under the Runtime workbench.
4-Create a new simple project in the Runtime workbench .
5-Click on EDU SOL: My New Wizards in the left pane of the dialog ,then select 
the “My Basic Wizard” option,then click next. 
6-Select the check box, “Select to set pageComplete true” .
7-Go to the packages view and open the file to inspect the contents.
(ui10.jpg) 
<<Error>>      
        Error code show in the Runtime workbench when great wizards with DBCS.
<<Expected Result>>
         No Error code show in the Runtime workbench when great wizards with 
DBCS.
Comment 1 leading CLA 2004-04-06 07:39:22 EDT
Created attachment 9252 [details]
the picture of  err code.

the picture of	err code.
Comment 2 Debbie Wilson CLA 2004-04-06 09:42:33 EDT
Was there anything in the .log file?
Comment 3 Tod Creasey CLA 2004-04-06 09:52:09 EDT
This is a websphere workbench project - we do not supply these so I am not 
sure what the issue is.

I can't read Chinese - are you saying that the text is not displaying 
correctly?

If so this may be a result of Bug 56195
Comment 4 Tod Creasey CLA 2004-04-06 09:52:44 EDT
Sorry - should be Bug 56915
Comment 5 leading CLA 2004-04-06 21:56:41 EDT
1.I use the command " ./eclipse -consolelog " to start the eclipse . and do 
this testcase again, but i not find *.log file .

2.sorry-  the step 5&6 of recreate the problem is:
  5-Click on EDU SOL: My New Wizards in the left pane of the dialog ,then 
select the "My Basic Wizard" option,then click next. 
  6-Select the check box, "Select to set pageComplete" true .

3. In this testcase, we import dialog.zip plug-in, and use it's wizard to 
create a file. But garbage charctors showed in the file's editor. (But in 
Win32/CHS, the result is OK)   
Comment 6 leading CLA 2004-04-06 22:02:20 EDT
Created attachment 9274 [details]
Testdata--dialogs.zip 

Testdata--dialogs.zip
Comment 7 Tod Creasey CLA 2004-04-07 07:56:09 EDT
What is the editor you are using for this file and what is the font?

This is difficult for us to trace as you are not using editors or projects 
that ship with Eclipse. Does this happen with an import or editing combination 
in Eclipse?

I suspect you are seeing Bug 56915.
Comment 8 leading CLA 2004-04-07 21:54:59 EDT
1- I am using the defult text editor and select editor's  Text file 
encoding  "Defult(EUC-KR) " for this file , the font is the system defult "Sana-
regular-10";
2- From now on, I have found  this problem only on this testcase .
Comment 9 Tod Creasey CLA 2004-04-08 07:57:37 EDT
Could you try the following please

1) Go to the fonts and colours preference page
2) Select Uncategorized - Text Font
3) Select Use System Font
4) Hit OK

Does your text render correctly now?
Comment 10 leading CLA 2004-04-08 12:30:32 EDT
yes,you are right. i do it as your say step by step.
Comment 11 Tod Creasey CLA 2004-04-12 11:26:11 EDT

*** This bug has been marked as a duplicate of 56915 ***
Comment 12 leading CLA 2004-04-16 06:09:52 EDT
This bug also exist on build wswb-I20040413-200404151406.

Comment 13 Tod Creasey CLA 2004-04-19 12:29:33 EDT
Why did you reopen this PR? Do you not think it is the same problem as Bug 
56915?

*** This bug has been marked as a duplicate of 56915 ***
Comment 14 leading CLA 2004-04-20 09:21:14 EDT
This may be a problem dup with #56915 which is supposed to be "resolved fixed" 
in I20040408 build and later.
BUT, we still saw this problem on eclipse I20040413 build. Therefore we 
reopened this bug against eclipse I20040413 build in case it is not actually 
dup w/ #56915. 

Please verify #56915 since Felipe said it has been Fixed in HEAD > 20040408. If 
you reopen #56915 afterwards and confirm these two bugs are same problems, 
please duplicate them again. Thanks
Comment 15 Tod Creasey CLA 2004-04-28 16:06:09 EDT
We can't verify this Bug as I am not sure exactly what you are doing 
differently. The bug we fixed is that you could not enter a DBCS character 
into an editor and have it render correctly.

From what I see here I am not sure what is different in your test case - the 
screenshot you are showing is an editor not rendering properly. It is not 
clear to me how you are generating its content.

Ines please verify that we can render DBCS characters on Linux.
Comment 16 leading CLA 2004-04-29 00:28:44 EDT
Hi Tod,
 We verified this defect on build IES-3.0-20040427 on RHEL WS 3.0(KOR) that it 
still occurred.
 Please change the "My new file Contents" and "RButton1 Text" in the 
test.properties file to encoding "\ucf64\ud6da\ubb4f". this defect will be re-
created.Thanks  
Comment 17 leading CLA 2004-04-30 07:44:27 EDT
We do more testing for this problem and found, for Korean font, if the 2nd byte 
is "DA" (ex: D6DA, D5DA, BADA), then it can not be display correct on editor, 
if you change the character to others which the 2nd byte is not "DA", then it 
could be displayed well on editor. 
And this problem only happened on RH_KOR not Win32_KOR.
Comment 18 Tod Creasey CLA 2004-04-30 08:18:31 EDT
Do you also get this problem when typing those characters directly into a text 
editor?

Moving to SWT as this is a rendering issue.
Comment 19 Grant Gayed CLA 2004-04-30 09:29:47 EDT
FH, bug still seen in 0427 build.
Comment 20 Felipe Heidrich CLA 2004-04-30 12:00:01 EDT
This can not be a duplicate of Bug#56915 cause this problem is in GTK!
What is the name of the font where it fails ? 
"Sana-regular-10" ? I don't have this font on system, wouldn't it be:
"Sans-regular-10"
Comment 21 Felipe Heidrich CLA 2004-04-30 12:00:59 EDT
Try to run this code in your machine, does it fail ?

import org.eclipse.swt.*;
import org.eclipse.swt.custom.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class PR57559  {
public static void main(String[] args) {
    Display display = new Display();    
    Shell shell = new Shell(display);
    shell.setLayout(new GridLayout());
    StyledText text = new StyledText(shell, SWT.MULTI | SWT.WRAP);
    text.setLayoutData(new GridData(GridData.FILL_BOTH));
    text.setText("\ucf64\ud6da\ubb4f \ud6da\ud5da\ubada");
    shell.setSize(500, 300);
    shell.open();
    while (!shell.isDisposed()) {
      if (!display.readAndDispatch()) {
        display.sleep();
      }
    }
    display.dispose();
}
}
Comment 22 leading CLA 2004-05-03 06:16:25 EDT
Hi, 
This test code is running successful. All those characters are displayed 
correct.
Comment 23 Felipe Heidrich CLA 2004-05-03 11:11:42 EDT
which font is bad ? The font that fails.
You guys can edit the code in comment21 adding the lines:
Font font = new Font ("name-of-bad-font", 12, SWT.NORMAL);
text.setFont(font);
 
Replace "name-of-bad-font" by the real name of the bad font, and replace 12 by 
the correct height as well, the same goes for the style, it can be SWT.NORMAL, 
SWT.BOLD, SWT.ITALIC.

Provide me with the failure situation.
Comment 24 leading CLA 2004-05-04 09:23:44 EDT
Created attachment 10252 [details]
refer the image file for the result.

Hi,
We use "Sans-regular-10", and we don't think that it's "bad font".
We run your code, the characters are displayed correct on first line, then we
directly copy/paste the result to 2nd line on the same panel, 
==> the char display as unicode. (refer PR57559.jpg).

We think, this problem has less connection with "font", then encoding convert.
We have try below code in eclipse on our RedHat. (LANG = ko_KR).

public class PR57559Bug {
	public static void main(String[] args) {
		// simulate the code in
com.ibm.wsweducation.solution.dialogs.MyNewFileWizardPage.java
		StringBuffer sb = new StringBuffer();
		sb.append("\ucf64\ud6da\ubb4f \ud6da\ud5da\ubada");
		byte[] bstr = sb.toString().getBytes();
		System.out.println("Source Unicode string length:
"+sb.length()+", after convert to Korean char: "+bstr.length);
		// In our machine, the output is "Source Unicode string length:
7, after convert to Korean char: 9"
		// before program write the byte[] to file, some Korea char
already become '?' (hex code is '0x3f')
	}
}
Comment 25 Felipe Heidrich CLA 2004-05-04 17:51:04 EDT
I've tested it (a lot). It looks like these unicode codepoints (\ud6da \ud6da 
\ud5da \ubada etc) have no equivalent in EUC-KR. When you copy the string to 
the clipboard the string is convert from Unicode to the default system 
encoding (EUC-KR in this case), the information is missed during the 
conversion.

The funny thing is: those are Korean characters, and on an English machine it 
works cause the default is UTF-8, but it fails on Korean machines (default 
encoding is to EUC-KR). There is nothing I can do about it.

The only solution I can think of is to set UTF-8 as the default encoding in 
Korean:
export LANG=ko_KR.UTF-8

Closing pr. Sorry but I can't be more helpful
Comment 26 leading CLA 2004-05-11 04:36:50 EDT
EUC-KR only supports subset of hangul characters that were expanded by Unicode 
2.0. We have to use UTF-8 locale to use full set of Hangul. Since this is EUC-
KR common restriction, not only in IES.So We decided to close it.