Forum Webscript.Ru

Программирование => PHP => Тема начата: frax от 29 Мая 2003, 23:13:21

Название: php mysql cyrillic chars
Отправлено: frax от 29 Мая 2003, 23:13:21
hi,

i have a problem with storing cyrillic text in a mysql db.
if i enter cyrillic characters in phpmyadmin all chars are converted to html special chars (#&1088 for example)
i could live with this, i didn´t found any way or solution to store cyrillic charcters without conversion.

the next problem is to convert the characters back.
html_entity_decode() doesn´t work neither does convert_cyr_string()

perhaps some of you can tell how to solve this problems or if there are english webpages about that topic, i didn´t find any.

thanks,

frax
Название: php mysql cyrillic chars
Отправлено: trent от 30 Мая 2003, 02:22:22
http://www.mysql.com/doc/en/configure_options.html#IDX246
http://www.mysql.com/doc/en/Character_sets.html

phpMyAdmin - choose Russian(ru-win-1251 or koi8-r)

add Russsian locale in u Operation System
Название: php mysql cyrillic chars
Отправлено: frax от 30 Мая 2003, 03:08:08
thank you very much !

due to your answer i recognized that the main problem isnt mysql, but the html charset of the page where the
is to enter data into the database.

and now i don´t know wether i should use utf-8 or windows-1251 or koi8-r.
it seems that data entered with koi8-r isn´t readable with utf-8 and vice versa

what should i use or whats the best way ?
can utf-8 (unicode) encounter problems (more problems) on some OS ?
whats the best for searching in the db ?
i really don´t understand how mysql stores the data entered.
depending on the charset from the html-file the chars in the database are different.
i also have some latin and german letters in the db and on the output-pages. can there be problems with cyrillic charsets ?

im very happy to find this place.
and i dont think i have many more questions after this.

thank you !

frax
Название: php mysql cyrillic chars
Отправлено: trent от 30 Мая 2003, 04:11:20
detect posted user charset and convert win-1251 (or koi8-r) to utf-8  using iconv (http://www.php.net/iconv)
storing all multi-language data in utf-8
for searching also convert search query to utf-8

P.S: sorry for english
Название: php mysql cyrillic chars
Отправлено: frax от 30 Мая 2003, 12:54:28
great, so the best is to use utf-8 for storing and koi8-r or win-1251 for output.
thank you very much !
Название: php mysql cyrillic chars
Отправлено: Abram от 27 Октября 2004, 16:19:41
Что-то ни фига не могу перевести. Как настроить MyADMIN с кодировкой win-1251?