Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Displaying a specific Unicode character

Reply
Thread Tools

Displaying a specific Unicode character

 
 
Jave
Guest
Posts: n/a
 
      09-05-2003
Hi everyone,

I'm trying to display the Nigerian currency symbol (naira) which
unicode code is 20a6 using the awt method drawString(String s). My
code look somehow like this:

g.drawString("324234 \u20a6");

This code seems to be correct as a lot of other characters like \u20a4
(pounds), \u20ac (euros), \u20a7 (spanish pesetas) etc. are displayed
perfectly.

I know it sounds weird but does anyone have a solution or at least an
explanation.

Thank you.

Jave
 
Reply With Quote
 
 
 
 
David Zimmerman
Guest
Posts: n/a
 
      09-05-2003


Jave wrote:

> Hi everyone,
>
> I'm trying to display the Nigerian currency symbol (naira) which
> unicode code is 20a6 using the awt method drawString(String s). My
> code look somehow like this:
>
> g.drawString("324234 \u20a6");
>
> This code seems to be correct as a lot of other characters like \u20a4
> (pounds), \u20ac (euros), \u20a7 (spanish pesetas) etc. are displayed
> perfectly.
>
> I know it sounds weird but does anyone have a solution or at least an
> explanation.
>
> Thank you.
>
> Jave


Are you sure that the Font has the symbol?

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      09-05-2003
On 5 Sep 2003 05:28:14 -0700, (Jave) wrote
or quoted :

>I know it sounds weird but does anyone have a solution or at least an
>explanation.


The problem is the font you use must also support that character. See
http://mindprod.com/jgloss/font.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
Roedy Green
Guest
Posts: n/a
 
      09-05-2003
On 5 Sep 2003 05:28:14 -0700, (Jave) wrote
or quoted :

>g.drawString("324234 \u20a6");
>
>This code seems to be correct as a lot of other characters like \u20a4
>(pounds), \u20ac (euros), \u20a7 (spanish pesetas) etc. are displayed
>perfectly.


I run into the same problem displaying the Naira symbol in the CurrCon
currency conversion applet see
http://mindprod.com/zips/java/currcon.html Most people don't have a
default font installed that can handle it. It just shows as a little
box, though it handles many of the other currency symbols.

The key would be to find a font that is
1. redistributable
2. truetype
3. supports the Naira

and then bundle it with your app and use that font just to display
currency symbols.




--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
Jave
Guest
Posts: n/a
 
      09-08-2003
Roedy Green, you are just the best, Tahoma supports this symbol and
now it works perfectly. Thanks to all of you.

Jave
 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Resolving unicode escapes to unicode character Tyler Ruby 1 07-29-2011 01:47 PM
Getting unicode escape sequence from unicode character? Kenneth McDonald Python 1 12-27-2006 10:27 PM
Is ViwState Page-Specific or UserControl-Specific =?Utf-8?B?SmF2?= ASP .Net 2 08-16-2006 09:30 PM
redirect traffic on specific ip to specific interface mimiseh Cisco 3 06-05-2005 09:14 PM
Unicode + jsp + mysql + tomcat = unicode still not displaying Robert Mark Bram Java 0 09-28-2003 05:37 AM



Advertisments