Skip to main content

Problem printing special characters

1 reply [Last post]
cgonzalez509
Offline
Joined: 2010-01-19
Points: 0

I am localizing my BDJ application to Spanish using lots of special characters such as the á, é, ñ, ... instead of those characters, I am getting weird characters such as nú for ú...

How can I show the character properly using java?

Regards

Message was edited by: cgonzalez509

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billf
Offline
Joined: 2004-02-13
Points: 0

There are a couple of different potential causes for that kind of problem.

First, check the character set of the document you're trying to display. For Java code, there's an argument that sets the character set of the .java file. If you're using the GRIN compiler, always use UTF-8.

Then, make sure the font you're using has glyphs for the characters you want to display.

If you get these two things right, it should "just work" - Java is all Unicode-based, so within the code you don't have to worry about character sets (unless you're reading a file, in which case there's API support for specifying the character set).