[英]What is the best charset encoding for sql query?
For example russian characters not reading, accent letters not read. 例如俄语字符不阅读,重音字母不阅读。
I tried with mysqli_set_charset("cp1251")
and with utf8
, not working. 我尝试使用
mysqli_set_charset("cp1251")
和utf8
,但无法正常工作。
I've tryed to insert string in sql like this htmlentities($str, ENT_QUOTES, "UTF-8");
我试图像这样的
htmlentities($str, ENT_QUOTES, "UTF-8");
在sql中插入字符串htmlentities($str, ENT_QUOTES, "UTF-8");
and for accent letters working perfectly but for russian characters the result is like this Øóôóòèíñêèé Ìèõàèë . 对于重音字母来说效果很好,但是对于俄语字符来说,结果就像ØóôóòèíññèèéÌèõàèë 。
Thanks. 谢谢。
It is important to use the same character set in the complete data chain. 在整个数据链中使用相同的字符集非常重要。 Mixed encodings will always cause problems.
混合编码总是会引起问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.