开发者

Strange bug with mysql encoding

开发者 https://www.devze.com 2023-03-01 21:27 出处:网络
I have an osTube site. All files saved in UTF-8. All tables created with utf8 utf8_unicode_ci, and all fields have same charset.

I have an osTube site. All files saved in UTF-8. All tables created with utf8 utf8_unicode_ci, and all fields have same charset.

At connect DB function added:

mysql_set_charset('utf8',$this -> connection);

Content at the site i开发者_如何学编程s russian and ukrainian. When I open it, I have no any problem. Problems begin when I try use caseless regular expression - it doesn't work.

I find that, Zend Debugger show variables content not readable, but debug encoding is UTF-8. If I delete line:

mysql_set_charset('utf8',$this -> connection);

At the site I see not readable text, but if I set at the browser Windows-1251 encoding - text begin readable. And Zend Debugger show normal text, and regexp begin work. But in the browser I see only '?????'.

What is this?


You're not clear about where you're using regular expressions? In PHP, you can enable UTF-8 support for the preg extension, using the u modifier.

See: http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php

0

精彩评论

暂无评论...
验证码 换一张
取 消