How to convert the window-1251 MySql database (Russian Cyrillic) to UTF-8

I have a russsian database and it is encoded in windows-1251. In other words, the letters look like this: phmyadmin: Âûõîäÿùàÿ â Ëîíäîíå ãàçåòà íà àðàáñêîì ÿçûêå «Àëü-Õàéÿò» ñîîáùèëà,. In other words, illegible heroes. For the content to display correctly, this code must be added to php.

header("Content-Type: text/html; charset=windows-1251");

I would like to migrate this site using open source software like joomla or wordpress without hiccups.

So, for this I need to convert these funny looking charachters to utf-8, which will look like this even in phpmyadmin:

       «-» ,

Any help would be greatly expanded.

+3
source share
1 answer

.sql iconv ( linux).

iconv -f utf-8 -t latin1 < in.sql | iconv -f cp1251 -t utf-8 > out.sql

, , LATIN1 (sql), UTF8 iconv?

, , , sql, .

+3

Source: https://habr.com/ru/post/1775743/


All Articles