[jadmin] MySQL DB: utf8 wrapped into utf8

Vadym Kononenko konan at red-team.org.ua
Fri Dec 29 08:04:16 CST 2006


Hi, all.
1. Have the worked jabberd2 = 2.0s11 server.
1.1. mysql "5.0.27-log" runned ander "cp1251" codepages.
1.2 All tables in "jabberd2" DB created in UTF-8 codepage.
1.3 phpMyAdmin show cyrilic chars as "D/D..." (unreadable).
1.4  All good working undependently of configuration in "my.cnf" (set section 
[client] default-character-set=utf8 or it is absent).

2. I need after transport domain changes ("icq.domain_1" to "icq.domain_2") 
change all data in DB too.
Make next script:
1) script-groups.mysql:
USE jabberd2;
SELECT * FROM `roster-groups`;

mysql -u root -p < script-groups.mysql > \`roster-groups\`.data

2) script-items.mysql:
USE jabberd2;
SELECT * FROM `roster-items`;

mysql -u root -p < script-items.mysql > \`roster-items\`.data

All cyrilic chars showed in UTF-8 codepage.
Now I change the data file. And set section [client] 
default-character-set=utf8 in "my.cnf" (or set UTF-8 options in a commands).

Cleaning all data in jabberd2 tables and load this by the some ways:
1. LOAD from this file
2. mysqlimport from this file
3. INSERT parsed data
After all this ways data is good showed in phpMyAdmin but Jabberd2 server show 
cyrilic chars as "?????".

I tried make dump of DB to "cp1251" and "UTF-8" charsets. All good exported 
and all is good readable in the used codepage.
-------
After some time I`ve remove section [client] default-character-set=utf8 
from "my.cnf" file and INSERT all UTF-8 data into database. Yess. It was good 
think, after this manipulations phpMyAdmin show cyrilic chars as "D/D..." 
(unreadable). 1.4  All good working undependently of configuration 
in "my.cnf" (set section [client] default-character-set=utf8 or it is 
absent).

I now tried make dump of DB to "cp1251" and "UTF-8" charsets. Cyrilic chars in 
exported file in "cp1251" codepage is anreadable ("???.??..?")
Cyrilic chars in exported file in "UTF-8" codepage is anreadable ("showed 
as "D/D..."). I know what is it. It is utf8 wrapped into utf8!!! :)

Can somebody comment it?
-- 
Best regards.
Vadym Kononenko.
Kyiv, Ukraine.



More information about the JAdmin mailing list