The Cyrillic character sets and collations are for use with Belarusian, Bulgarian, Russian, Ukrainian, and Serbian (Cyrillic) languages.
cp1251
(Windows Cyrillic) collations:cp1251_bin
cp1251_bulgarian_ci
cp1251_general_ci
(default)cp1251_general_cs
cp1251_ukrainian_ci
cp866
(DOS Russian) collations:cp866_bin
cp866_general_ci
(default)
koi8r
(KOI8-R Relcom Russian) collations:koi8r_bin
koi8r_general_ci
(default)
koi8u
(KOI8-U Ukrainian) collations:koi8u_bin
koi8u_general_ci
(default)
1. alter your table to include information about character sets that are used in your table (see section Converting 4.0 Character Columns to 4.1 Format). Most of us have to do this step because usually you inherit your tables from MySQL 4.0 If you created your table and specified character sets there is no need to do this step. Verify your actions using SHOW FULL COLUMNS FROM table_name.
2. SET NAMES KOI8R. (see section Connection Character Sets and Collations for details). It explains that your I/O is done in KOI8R
3. SELECT name,namew FROM table_name;
Database will convert UTF8,cp1251--> koi8r for you and will produce results in koi8r character set that you can see on your terminal. You can also do
UPDATE table_name SET name='koi8r-typed-russian-word'
and database will convert your string that you typed in koi8r into UTF-8 format and store in your table.
mysql> SHOW CHARACTER SET;
maybe to make test with this:
-------------------test.php------------------------------------
-------------------------------------------------------------------
mysql_query("SET NAMES CP1251");
Thats all ... ! Good luck ... !