Problem In Displaying Umlaut Characters In Linux

V

vijay

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:eek:utput 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
 
R

Rhino

vijay said:
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:eek:utput 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

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".
 
G

Gordon Beaton

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
 
G

Gordon Beaton

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
 
R

Rhino

Gordon Beaton said:
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).


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!
 
V

vijay

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,
 
V

vijay

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,
 
G

Gordon Beaton

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
 
V

vijay

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
 
G

Gordon Beaton

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?

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
 
V

vijay

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top