The Artima Developer Community
Sponsored Link

Java Answers Forum
Problem with charset

1 reply on 1 page. Most recent reply: Oct 31, 2002 2:30 PM by Velika Srbija

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Velika Srbija

Posts: 2
Nickname: srbija
Registered: Oct, 2002

Problem with charset Posted: Oct 31, 2002 2:28 PM
Reply to this message Reply
Advertisement
I'm using JSP, Tomcat 4 and MySQL

I have made web-app that uses iso-latin-2 charset.
I'll describe shortly what happens with my application.
----------------------------

I set meta tag charset=iso-8859-2 on every .jsp page.

When I receive data from my input form, some
characters (that are out of iso-8859-1, i.e. belongs
to iso-8859-2) comes in form of &#nnn; (e.g.
?=š č=č etc.) That is OK!!!

For example, if an input in a textfield
(named "school") on the .jsp page that contains form was: ?kola after pressing Submit, on the
following .jsp page I can read that parameter as:

String str = request.getParameter("school");

Parameter str is now equal to škola

When I print parameter "str" onto my .jsp page it
appears OK:

<%= str %> produces ?kola when rendered onto .jsp page

Storing data that contain that sort of chars (e.g.
&#353;, &#269; &#263; etc.) into my database, makes it
longer than it should be, e.g.:


?kola - from my input form (length=5)
is equal to:
&amp;#353;kola - when stored into database (length=10)

I want to write into my database datas of exactly the same size as they apper when rendered in an HTML(JSP) page.

What way I could fix it?


Velika Srbija

Posts: 2
Nickname: srbija
Registered: Oct, 2002

Re: Problem with charset Posted: Oct 31, 2002 2:30 PM
Reply to this message Reply
This is correect:

&#353;=&amp;#353;

consider it instead of ?

Flat View: This topic has 1 reply on 1 page
Topic: MySQL database hosting Previous Topic   Next Topic Topic: Problem in String Class

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use