2

Have a problem with the cyrillic encoding cyrillic data from mysql displayed correct, but when I add some cyrillic text on the page I get someting like this ывааапв

data in MySQl - utf8_general_ci

php file:

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

mysql_query('SET NAMES cp1251');
jhenya-d
  • 399
  • 7
  • 19

1 Answers1

4

You're adding the text in utf-8, while your page in 1251.
So, set your editor into Windows-1251 when adding text

OR

change your headers from 1251 to utf-8

header('Content-Type: text/html; charset=utf-8'); 
mysql_query('SET NAMES utf8');
Ivan Z
  • 1,517
  • 1
  • 16
  • 25
Your Common Sense
  • 156,878
  • 40
  • 214
  • 345