Subject | Re: Charactet Set problems, help? |
---|---|
Author | momchilov |
Post date | 2004-08-26T11:25:29Z |
> Then print the characters you get from the database on the consoleas
> integers. Something like:After this i get 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 with
> Tomcat/Servlet/JSP that incorrectly converts them.
>
> Roman
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...