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 console is using the StyledText widget, I verified that StyledText 
displays the characters correctly when using the same font set in the 
Console.
This doesn't appear to be font related anyway. When I run the same println 
outside Eclipse, on the command line it also does not print correctly. It 
looks like something gets messed up on the way through System.out.println. 
What is the file.encoding VM/system property set to? This is displayed as 
the default text file encoding on the Workbench/Editors preference page.
You could try running Eclipse with the vm argument -Dfile.encoding=UTF-8

Knut




Andre John Mas <ajmas@xxxxxxxxxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx
04/24/2003 04:08 PM
Please respond to platform-swt-dev

 
        To:     platform-swt-dev@xxxxxxxxxxx
        cc:     Steve_Northover@xxxxxxxxxx
        Subject:        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

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




Back to the top