DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Displaying The Correct Glyph
Notices
Reply
 
LinkBack Thread Tools Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Jul 2009
Default Displaying The Correct Glyph - 07-02-2009, 10:24 AM

Hi Guys,

I have a problem. I'm trying to display the glyph for "£" from its string literal which is "& # 1 6 3 ;". I've got two strings

Code:
	String a = "£";
	String b = "& # 1 6 3 ;";
and I output the values to the console;

Code:
       System.out.println(a);
       System.out.println(b);
String a comes out as "£" but String b is not converted to the same glyph. Why doesn't eclipse do this when the editor for this post does?

NOTE: that the string "& # 1 6 3 ;" should not have spaces in between the characters, but it was the only way I could display the String without the editor converting it to the £ glyph.
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 11
Thanks: 0
Thanked 2 Times in 2 Posts
Join Date: May 2009
Default 07-03-2009, 06:32 AM

Why not use char instead of String?

Code:
char a = 163; // the unicode character with number 163

System.out.println(a);
Reply With Quote
  (#3 (permalink)) Old
Active Contributor
 
Posts: 62
Thanks: 0
Thanked 6 Times in 6 Posts
Join Date: Jun 2009
Default 07-07-2009, 04:21 AM

1. '£', this symbol is copied to java editor from somewhere else. In Eclipse, if you copy one encode which is not set by java editor to java editor. Java editor won't support.
2. Set the encode of the java editor to ISO-8859-1. you can make it through Window->Preference->General->Editors->Text Editors->Spelling->Dictionarier->Encode


www.eclaxy.com
let's perfect the eclipse!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying multiple figures in one editpart ritututeja9 Eclipse 0 12-08-2008 06:22 AM
Displaying unicode characters in org.eclipse.swt.widgets.Table widget digital2k8 Eclipse 0 03-05-2008 09:11 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com