International i18n character problems

Discussion in 'Java' started by Timasmith, Mar 8, 2007.

  1. Timasmith

    Timasmith Guest

    Hi,

    I have text entered in a web page which is posted as this:

    This is my test!

    à, è, ì, ò, ù - À, È, Ì, Ò, Ù

    директора Хьюман Ð Ð°Ð¹Ñ‚Ñ Ð’Ð¾Ñ‚Ñ‡ Кеннета РоÑÑа

    In my servlet I do the following:

    byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
    utf8String = new String(stringBytesISO, "UTF-8");

    This fixed the problems with characters with an accent but the russian
    characters are still saving as question marks - is this a JDBC
    problem, JSP or Java problem??

    thanks

    Tim
     
    Timasmith, Mar 8, 2007
    #1
    1. Advertising

  2. Timasmith wrote:
    > Hi,
    >
    > I have text entered in a web page which is posted as this:
    >
    > This is my test!
    >
    > à, è, ì, ò, ù - À, È, Ì, Ò, Ù
    >
    > директора Хьюман Ð Ð°Ð¹Ñ‚Ñ Ð’Ð¾Ñ‚Ñ‡ Кеннета РоÑÑа
    >
    > In my servlet I do the following:
    >
    > byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
    > utf8String = new String(stringBytesISO, "UTF-8");
    >
    > This fixed the problems with characters with an accent but the russian
    > characters are still saving as question marks - is this a JDBC
    > problem, JSP or Java problem??
    >
    > thanks
    >
    > Tim


    The problem is an encoding problem. ISO-8859-1 (actually Cp1252, I
    believe) is a Western European encoding, so it cannot represent Russian
    characters.
     
    Joshua Cranmer, Mar 8, 2007
    #2
    1. Advertising

  3. Timasmith

    Timasmith Guest

    On Mar 8, 6:22 pm, Joshua Cranmer <> wrote:
    > Timasmithwrote:
    > > Hi,

    >
    > > I have text entered in a web page which is posted as this:

    >
    > > This is my test!

    >
    > > à, è, ì, ò, ù - À, È, Ì, Ò, Ù

    >
    > >  директора Хьюман Ð Ð°Ð¹Ñ‚Ñ Ð’Ð¾Ñ‚Ñ‡ Кеннета РоÑÑа

    >
    > > In my servlet I do the following:

    >
    > >        byte[] stringBytesISO = isoString.getBytes("ISO-8859-1");
    > >        utf8String = new String(stringBytesISO, "UTF-8");

    >
    > > This fixed the problems with characters with an accent but the russian
    > > characters are still saving as question marks - is this a JDBC
    > > problem, JSP or Java problem??

    >
    > > thanks

    >
    > > Tim

    >
    > The problem is an encoding problem. ISO-8859-1 (actually Cp1252, I
    > believe) is a Western European encoding, so it cannot represent Russian
    > characters.- Hide quoted text -
    >
    > - Show quoted text -


    Ok, that makes sense. So my post to Google works fine. What encoding
    is the string being posted as that I can convert from instead?
     
    Timasmith, Mar 9, 2007
    #3
  4. Timasmith

    DC Guest

    instead accept in unicode encoding/ wide char and then convert it to
    multibye (byte[])
     
    DC, Mar 9, 2007
    #4
  5. Timasmith

    Oliver Wong Guest

    "Timasmith" <> wrote in message
    news:...
    On Mar 8, 6:22 pm, Joshua Cranmer <> wrote:
    >
    > Ok, that makes sense. So my post to Google works fine. What encoding
    > is the string being posted as that I can convert from instead?


    Your Usenet posting used quoted-printable
    (http://en.wikipedia.org/wiki/Quoted_printable), which doesn't apply to
    the HTTP protocol AFAIK. The closest equivalent would be to use entity
    references
    (http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references)

    - Oliver
     
    Oliver Wong, Mar 15, 2007
    #5
    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. sy

    international character

    sy, Oct 15, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    323
  2. Albretch
    Replies:
    11
    Views:
    666
    Albretch
    Sep 10, 2004
  3. Replies:
    1
    Views:
    331
    Jukka K. Korpela
    Jul 4, 2006
  4. Luke
    Replies:
    1
    Views:
    347
    Lothar Kimmeringer
    Feb 18, 2008
  5. Replies:
    7
    Views:
    177
    Evertjan.
    Jun 22, 2006
Loading...

Share This Page