Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

International i18n character problems

Thread view: 
Timasmith - 08 Mar 2007 21:53 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.