Subject | Re: [Firebird-Java] Re: JSP Turkish Character Problems.... |
---|---|
Author | Roman Rokytskyy |
Post date | 2005-03-15T08:32:46Z |
> Roman, thank you for your help. But i changed my code. Now noI suspect other thing - they are not "?" in database, but normal Turkish
> exception but some special Turkish characters like '?' this in
> database.
>
> Connection conn = DriverManager.getConnection
> ("jdbc:firebirdsql:localhost/3050:" + database + "?user=" + user
> + "&password=" + password + "&encoding=WIN1254");
characters. However your application is not displaying them correctly. To
check this, simply print the character codes of the string you get from DB
to the console:
String myStr = rs.getString(1);
char[] chars = myStr.toCharArray();
for(int i = 0; i < chars.length; i++) {
System.out.println("chars[" + i + "] = " + ((int)chars[i]));
}
Please note the casting of char to int, if you do not do this, you will see
characters, not their codes.
Roman