File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Question related to java.util.Currency's getSymbol method. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Question related to java.util.Currency Watch "Question related to java.util.Currency New topic
Author

Question related to java.util.Currency's getSymbol method.

Peeyush Bhadola
Greenhorn

Joined: Jan 23, 2011
Posts: 10

Ok so my question is when I instantiate java.util.Currency with US locale, the getSymbol(Locale locale) method returns $ as symbol. But when I use any other locale (say Japanese) it returns ? (question mark). Is there a way to get Japanese currency character(¥) just like I am getting in case of US Locale?



Peeyush
Winston Gutkowski
Bartender

Joined: Mar 17, 2011
Posts: 7029
    
  16

Peeyush Bhadola wrote:But when I use any other locale (say Japanese) it returns ? (question mark).

Are you displaying this on the console? If so, that's probably the issue - consoles are generally only good for displaying basic ASCII characters (and maybe a few others).

You might try displaying it in a dialog box and see if it works - GUI components are generally better for stuff like that than a console. If that doesn't work, you may have to set up a proper panel with fields.

If you simply want to make sure that you have the correct character, display it and its numeric value. That, at least, will confirm that you have the right value (you can look it up on one of the gazillion Unicode tables on the Net).

Winston


Isn't it funny how there's always time and money enough to do it WRONG?
Artlicles by Winston can be found here
Peeyush Bhadola
Greenhorn

Joined: Jan 23, 2011
Posts: 10

Thank you so much Winston. I tried it on JOptionPane's message dialog and it worked. Many thanks.
 
wood burning stoves
 
subject: Question related to java.util.Currency's getSymbol method.
 
Similar Threads
Getting currency symbols
java.util.*;
Localized Currency formatting issue
Regional settings
problen about unreadable character when a currency character is expected(CHINESE)