Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] UTF-8 support and compliant components


Can you enter these characters into Word or Wordpad?  If the font doesn't
have the unicode glyphs, it can't draw the characters.  Try this code.
It appears that the font used by the Eclipse console doesn't have \u039e
but the default font for the text widget does.  Not sure about the rest.

public static void main (String [] args) {
        Display display = new Display ();
        Shell shell = new Shell (display);
        Text text = new Text (shell, SWT.SINGLE | SWT.BORDER);
        text.setText ("123-\u0067\u0035\u039e\u322F\u5193");
        System.out.println ("123-\u0067\u0035\u039e\u322F\u5193");
        text.pack ();
        shell.pack ();
        shell.open ();
        while (!shell.isDisposed ()) {
                if (!display.readAndDispatch ()) display.sleep ();
        }
        display.dispose ();
}



Andre John Mas <ajmas@xxxxxxxxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

04/23/2003 11:53 AM
Please respond to platform-swt-dev

       
        To:        platform-swt-dev@xxxxxxxxxxx
        cc:        
        Subject:        Re: [platform-swt-dev] UTF-8 support and compliant components



Andre John Mas wrote:
> Is there a chart anywhere indicating which components are UTF-8 compliant?
>

I forgot to mention that I am asking the question because the
following code:

  System.out.println("123-\u0067\u0035\u039e\u322F\u5193");

when run in Eclipse 2.1 gives me, under Windows 2000:

  123-g5???

instead of the expected characters (display will depend on your OS
and mail client):

  123-g5Ξ㈯冓

I am not sure whether this issue is because of the implementation
of the SWT component underlying the  Console in Eclipse, because
of the way Eclipse is implemented or due to the JDK configuration
that I am using.

Any help would be very much appreciated.

Thanks

Andre




_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top