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
Joshua Cranmer - 08 Mar 2007 23:22 GMT
> Hi,
>
[quoted text clipped - 18 lines]
>
> 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.
Timasmith - 09 Mar 2007 01:07 GMT
> Timasmithwrote:
> > Hi,
[quoted text clipped - 25 lines]
>
> - 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?
DC - 09 Mar 2007 03:15 GMT
instead accept in unicode encoding/ wide char and then convert it to
multibye (byte[])
Oliver Wong - 15 Mar 2007 18:38 GMT
On Mar 8, 6:22 pm, Joshua Cranmer <Pidgeo...@epenguin.zzn.com> 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