International i18n character problems

T

Timasmith

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
 
J

Joshua Cranmer

Timasmith said:
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.
 
T

Timasmith

Timasmithwrote:
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??

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?
 
D

DC

instead accept in unicode encoding/ wide char and then convert it to
multibye (byte[])
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,173
Latest member
GeraldReund
Top