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

The font I use is 'Courier New'. I have just looked at the preferences
under 'Workbench -> Fonts' and I see the the 'Debug Console Text Font'
is indeed Courier New. Using Notepad, Wordpad and Character Map I see
that the font is capable of displaying these glyphs.

I have installed all the possible language settings in Control Panel
-> Regional Options.

Maybe having someone try a similar test on MacOS X, which I know is also
a unicode compliant platform may give some insight.

regards

Andre

Steve Northover wrote:

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

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



Back to the top