0

I tried with mysqli_set_charset("cp1251") and with utf8, not working.

I've tryed to insert string in sql like this htmlentities($str, ENT_QUOTES, "UTF-8"); and for accent letters working perfectly but for russian characters the result is like this Øóôóòèíñêèé Ìèõàèë.

Thanks.

vaneayoung
  • 353
  • 1
  • 4
  • 22

1 Answers1

2

It is important to use the same character set in the complete data chain. Mixed encodings will always cause problems.

  • Set the table or column encoding to charset x
  • Set the database connection encoding to charset x
  • Set the internal encoding of PHP to charset x or convert the string
  • Set the input and output client (mysql console, browser or cli) encoding to charset x
  • When you are using a browser check the encoding which is set in the http header, too. Depending on the browser this value might overwrite an exisiting meta tag in the html header!
Izzet Beltir
  • 126
  • 4