Problem In Displaying Umlaut Characters In Linux

Discussion in 'Java' started by vijay, Apr 5, 2006.

  1. vijay

    vijay Guest

    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
    vijay, Apr 5, 2006
    #1
    1. Advertising

  2. vijay

    Rhino Guest

    "vijay" <> wrote in message
    news:...
    > 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".

    --
    Rhino
    Rhino, Apr 5, 2006
    #2
    1. Advertising

  3. On Wed, 5 Apr 2006 09:19:52 -0400, Rhino wrote:
    > 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

    --
    [ 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
    Gordon Beaton, Apr 5, 2006
    #3
  4. On 5 Apr 2006 03:05:43 -0700, vijay wrote:
    > 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

    --
    [ 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
    Gordon Beaton, Apr 5, 2006
    #4
  5. vijay

    Rhino Guest

    "Gordon Beaton" <> wrote in message
    news:4433cb06$...
    > On Wed, 5 Apr 2006 09:19:52 -0400, Rhino wrote:
    >> 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?
    >

    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
    Rhino, Apr 5, 2006
    #5
  6. vijay

    vijay Guest

    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,
    vijay, Apr 6, 2006
    #6
  7. vijay

    vijay Guest

    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,
    vijay, Apr 6, 2006
    #7
  8. On 5 Apr 2006 22:45:06 -0700, vijay wrote:
    > 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

    --
    [ 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
    Gordon Beaton, Apr 6, 2006
    #8
  9. vijay

    vijay Guest

    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
    vijay, Apr 6, 2006
    #9
  10. On 6 Apr 2006 05:29:38 -0700, vijay wrote:
    > 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

    --
    [ 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
    Gordon Beaton, Apr 6, 2006
    #10
  11. vijay

    vijay Guest

    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,
    vijay, Apr 7, 2006
    #11
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?J=FCrgen_Kahrs?=

    Umlaut characters in Unicode

    =?ISO-8859-1?Q?J=FCrgen_Kahrs?=, Nov 12, 2004, in forum: XML
    Replies:
    11
    Views:
    10,904
    =?ISO-8859-1?Q?J=FCrgen_Kahrs?=
    Nov 13, 2004
  2. Anna Kavan
    Replies:
    0
    Views:
    385
    Anna Kavan
    Oct 31, 2006
  3. Dirk Einecke
    Replies:
    8
    Views:
    212
    Dirk Einecke
    Apr 12, 2004
  4. John Butler
    Replies:
    7
    Views:
    170
    John Butler
    May 2, 2008
  5. Replies:
    15
    Views:
    564
    Peter J. Holzer
    Sep 28, 2010
Loading...

Share This Page