Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

Problem In Displaying Umlaut Characters In Linux

Thread view: 
vijay - 05 Apr 2006 11:05 GMT
Hi All,

Im using java,mysql,xml and xsl for one of my project

Java version 1.4.2 and Mysql 4.1.18

when i store or retrive data into/from mysql using xml/xsl/html/java on
windows platform
everything is working fine. I can store and retrive umlauts and special
characters.

But the same code is not working on linux. The version of linux im
using is Suse 9

i have used folowing code for xsl

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" indent="yes"/>

But on linux special charactears are not getting displayed properly.
Does linux not support umlauts or i need to do some changes in my code?
Do i need to change something in java code?
Please help me..........

Thanks in advance,

Vijay Tandel
Rhino - 05 Apr 2006 14:19 GMT
> Hi All,
>
[quoted text clipped - 25 lines]
>
> Vijay Tandel

I assume that you are getting tiny squares or question marks where you
expected to see 'a' with umlaut characters.

If you look at encoding charts, I think you'll find that umlauts are not
treated as full characters, they are accents that appear _with_ a letter of
the alphabet like 'a' or 'e'.

Your encoding scheme, iso-8859-1, also known as "Latin-1" supports umlauts
with the letters 'e', 'i', and 'y' but not with 'a' according to
http://www.utoronto.ca/webdocs/HTMLdocs/NewHTML/iso_table.html.

You need to use an encoding scheme that supports umlauts on all of the
letters including 'a'. Try "UTF-8" instead of "iso-8859-1".

--
Rhino
Gordon Beaton - 05 Apr 2006 14:54 GMT
> If you look at encoding charts, I think you'll find that umlauts are
> not treated as full characters, they are accents that appear _with_
> a letter of the alphabet like 'a' or 'e'.

In Swedish, Å (Aring), Ä (Auml) and Ö (Ouml) are regular letters,
entirely distinct from A and O (i.e. they are not simply accented
versions of A and O).

> Your encoding scheme, iso-8859-1, also known as "Latin-1" supports
> umlauts with the letters 'e', 'i', and 'y' but not with 'a'
> according to
> http://www.utoronto.ca/webdocs/HTMLdocs/NewHTML/iso_table.html.

Then what are characters 196 and 228?

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

Rhino - 05 Apr 2006 19:24 GMT
>> If you look at encoding charts, I think you'll find that umlauts are
>> not treated as full characters, they are accents that appear _with_
[quoted text clipped - 10 lines]
>
> Then what are characters 196 and 228?

My mistake! I misread the chart: I thought there was only one set of columns
showing the character, decimal value, hex value and 'entity reference'. I
see now that there were two such sets of columns. I only looked in the
second set of columns and missed the other umlauted characters.

My apologies for the inadvertent misinformation!

--
Rhino
vijay - 06 Apr 2006 06:39 GMT
Hi,

Thanx for ur kind help...

The problem is excetly same as u have explained. It display eigther
question mark or some tiny squares.

Before this is was using UTF-8 encoding. But with this characterset i
was not able to diplay or store umlaut characters on windows platform.
So i tried ISO-8859-1

on windows platform its working fine now. But linux is giving problem.
Now i dont have much experience on linux.

I can explain the flow of my code. It is as below.

My java code takes care of generating the xml to be displayed.
(generate diffrent fields like textbox,textarea,radiobox etc).

I use xsl stylesheet to display the page. and when i submit the form
jsp controller takes care of rest of the process. Like call the bean to
store and retrivew data and redirect to relavent page.

now on windows the string whcih has to be stored into database is
converted and stored fine.
but in linux it stores the wrong charactes into database itself.

so at the time of display it display wrong characters. So some thing
worg in java code?
which converts the string into worng formate which storing into
database?

Thank you,
Gordon Beaton - 05 Apr 2006 14:59 GMT
> But on linux special charactears are not getting displayed properly.
> Does linux not support umlauts or i need to do some changes in my code?

Linux is perfectly capable of displaying these characters, and
contrary to other advice, iso-8859-1 (latin 1) is the correct encoding
to use.

What mechanism are you using to display the characters?

What does /usr/bin/locale tell you about the default language and
character type in your shell?

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

vijay - 06 Apr 2006 06:45 GMT
hi,

thanks for ur kind help,

well im not regular user of linux.... my hosting server is linux so i
dont have much knowledge about it..
but can u tell me what locale and language should i set for my code to
work?.

i did some search for linux and it says ISO-8859-1 is the default
characterset for linux.
the verision of linux im using is suse 9

thanks,
Gordon Beaton - 06 Apr 2006 08:03 GMT
> i did some search for linux and it says ISO-8859-1 is the default
> characterset for linux. the verision of linux im using is suse 9

There is no universal default character set for linux, it's whatever
you have set it to on your system. And every shell can have a
different character set by simply changing some environment variables.

So I'll ask again: what (Java) mechanism are you using to display the
characters?

And: what does /usr/bin/locale report?

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

vijay - 06 Apr 2006 13:29 GMT
As u told me i report the /usr/bin/locale

it shows me default language and characterset is Lang=en_US.UTF-8

means the character set is UTF-8

so if i add one more character set ISO-8859-1 in linux my code should
work fine right?

and the michanisum is very simple as i explained earlier

I use java/jsp to store/retrivew data
and xsl/xml to display data on page

Thanx
Gordon Beaton - 06 Apr 2006 14:14 GMT
> As u told me i report the /usr/bin/locale
>
[quoted text clipped - 4 lines]
> so if i add one more character set ISO-8859-1 in linux my code
> should work fine right?

If the default is UTF-8 you should be ok, you don't need to add
ISO-8859-1.

> and the michanisum is very simple as i explained earlier
>
> I use java/jsp to store/retrivew data
> and xsl/xml to display data on page

This is sorely lacking in details, but I don't have the patience to
guess or hold your hand with this. Perhaps someone who knows jsp can
help.

/gordon

Signature

[  do not email me copies of your followups  ]
g o r d o n + n e w s @  b a l d e r 1 3 . s e

vijay - 07 Apr 2006 08:30 GMT
hi,

By doing some changes i came to know that the data are getting stored
properly into database.
but now the only problem is when i retrivew the data..

i think its the problem of resultset when i retriew the data from
database
the driver im using is org.gjt.mm.mysql.Driver for mysql 4.1.18

is it possible that the drivers are not supported on linux version?
if so how is it string data into database?

and can anyone tell me how can i view the envirnment variable setting
on linux

in radhat we can check into .bash file but i have no idea about suse
9.1

Thanks,


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.