Subject | Re: Charactet Set problems, help? |
---|---|
Author | momchilov |
Post date | 2004-08-26T14:12:31Z |
It's stupid to reply to myself, but there is some progress...
I've managed to display the info from database in cyrilic by adding:
<%@ page language="java" contentType="text/html; charset=Cp1251" %>
to the beggining to every .jsp file.
But now something other is wrong! I have a html form page, and when i
enter in the form cyrilic text, again blank spaces in database.
Nothing is entered. The html file send the info to a jsp file, and
when i display the entered info from the jsp file, again
these "?????" (question marks) like before... :(
Tnight my dreams will be question marks all over the place....
--- In Firebird-Java@yahoogroups.com, "momchilov" <momchilov@y...>
wrote:
I've managed to display the info from database in cyrilic by adding:
<%@ page language="java" contentType="text/html; charset=Cp1251" %>
to the beggining to every .jsp file.
But now something other is wrong! I have a html form page, and when i
enter in the form cyrilic text, again blank spaces in database.
Nothing is entered. The html file send the info to a jsp file, and
when i display the entered info from the jsp file, again
these "?????" (question marks) like before... :(
Tnight my dreams will be question marks all over the place....
--- In Firebird-Java@yahoogroups.com, "momchilov" <momchilov@y...>
wrote:
> > Then print the characters you get from the database on theconsole
> aswith
> > integers. Something like:
> >
> > String myString = rs.getString(1);
> > char[] chars = myString.toCharArray();
> > for(int i = 0; i < chars.length; i++) {
> > System.out.println("char[" + i + "] = " + (int)chars[i]);
> > }
> >
> > If you get different character codes, then you ahve the problem
> > Tomcat/Servlet/JSP that incorrectly converts them.
> >
> > Roman
>
> After this i get something like:
>
> char[0] = 1045
> char[1] = 1083
> char[2] = 1077
> char[3] = 1082
> char[4] = 1090
> char[5] = 1088
> char[6] = 1086
> char[7] = 1085
> char[8] = 1085
> char[9] = 1080
> char[10] = 32
> char[11] = 1082
> char[12] = 1086
> char[13] = 1084
> char[14] = 1087
> char[15] = 1086
> char[16] = 1085
> char[17] = 1077
> char[18] = 1085
> ....
> ....
>
> Sorry for the dummy question (this is my first project with
> JSP/Tomcat), how to check if Tomcat/Servlet/JSP converts them
> incorectly?
>
> Thank you very much for the replies...