Java , Unix & Spanish Characters

September 30, 2010 at 1:59 pm Leave a comment

Had a problem with Spanish Characters , JDK1.6 , Oracle 10g in Unix Environment.

The country name “Panamá” when retrieved from database was displayed in application log with a question mark (?) instead of “á” .
When connecting to DB with sqlplus from Unix box and viewing the value using select query was also displaying the same question mark.

The character set of DB was UTF8 which could store Spanish characters properly.
So where is the problem??…
When connecting to DB with NLS_LANG set to WE8ISO8859P1 showed proper Spanish characters in place. So the issue was not at the DB end.

Our java application was getting screwed up for some strange reasons.
Solution to the issue was to start the java application with correct file.encoding parameter.
Unix box was having the default file.encoding US-ASCII which will not handle Spanish characters properly.

So starting application as : java -Dfile.encoding=ISO-8859-1 would override the default and use the correct character set correctly which solved the issue.

Advertisement

Entry filed under: tips and tricks. Tags: , .

Move/Rearrange HTML table rows Count open connections for a process – SOLARIS

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


 

September 2010
M T W T F S S
« May   Oct »
 12345
6789101112
13141516171819
20212223242526
27282930  

Follow

Get every new post delivered to your Inbox.