Karol Matysiak wrote: When I set utf-8 in my mysql database I don't get polish characters when I'm selecting data, so I can't use utf-8
Programming is about thinking, NOT coding
jatan bhavsar wrote:Hi Karol,
Try to work this way and let me know what type of error are you getting i might be able to help you.
Also have you set the UTf-8 encoding type for the glassfish server like <parameter-encoding default-charset="UTF-8"/>.
This is wrong, as UTF-8 is the most accepted encoding, until unless you want to use UTF-16 :)
As for the character encoding filter, is it the first filter (in the filter chain) in your xml? Otherwise it will not work as intended. Also did you tried setting the connection encoding to the required encoding, like
I did it for UTF-8, you can use your encoding , if you desire.
Also is your page encoding using the required one, or is it using the default one?
Try these and let us know.
Karol Matysiak wrote: I know, but I can't set up my db server to utf-8
Karol Matysiak wrote: After change (it's now encoding to latin2, same as mysql server) the data which was in the database is displaying as earlier - Krokosiäski, but when I will add somethign through the form on index page, everything is fine (it displays Krokosiński )
Programming is about thinking, NOT coding
Vishal Shaw wrote:
Did you mean, you are trying but can't set it, or you have been forbidden to set it?
Vishal Shaw wrote:
I think your filter is encoding only request parameters not the response object. So, you can try setting it on response objects too, alternatively try adding
in your HibernateTest.java
Bear Bibeault wrote:"rok"?
Karol Matysiak wrote:I'm using windows 7 (sadly)
I've got MySQL server with database encoded to latin2
When I set utf-8 in my mysql database I don't get polish characters when I'm selecting data, so I can't use utf-8 ;/
Paul Clapham wrote:
You can't just change the configuration and expect it to work correctly. All that does is to assert that data which was already encoded in latin2 is now encoded in UTF-8.
Which of course it isn't. You have to export all the data from the database to a text file, then change the configuration, then import all the data back from that text file.
+----------------------+-----------------+
| Variable_name | Value |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database | utf8_polish_ci |
| collation_server | utf8_polish_ci |
+----------------------+-----------------+
+--------------------------+----------------------------------------------------
-----+
| Variable_name | Value
|
+--------------------------+----------------------------------------------------
-----+
| character_set_client | utf8
|
| character_set_connection | utf8
|
| character_set_database | utf8
|
| character_set_filesystem | BINARY
|
| character_set_results | utf8
|
| character_set_server | utf8
|
| character_set_system | utf8
|
| character_sets_dir | C:\Program Files\MySQL\MySQL Server 5.5\share\chars
ets\ |
+--------------------------+----------------------------------------------------
[WinMySQLAdmin]
Server="C:/Program Files/MySQL/MySQL Server 5.5/bin/mysqld.exe"
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqladmin]
default-character-set=utf8
[mysqlcheck]
default-character-set=utf8
[mysqldump]
default-character-set=utf8
[mysqlimport]
default-character-set=utf8
[mysqlshow]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_polish_ci
init_connect='SET collation_connection = utf8_polish_ci'
init_connect = 'SET NAMES utf8'
We've gotta get close enough to that helmet to pull the choke on it's engine and flood his mind! Or, we could just read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|