简体   繁体   English

Yii在searchForm Lable中编码错误(UTF-8)

[英]Yii wrong encoding(UTF-8) in searchForm Lable

I have a problem in my view fromm SearchForm in a Yii Project. 我在Yii项目中的SearchForm视图中存在问题。 In the lables there are <?> <?> instead of "ä,ö,ü" but this error is only in the searchForm, the rest of the page works fine. 在标签中有<?> <?>而不是“ä,ö,ü”但这个错误仅在searchForm中,页面的其余部分工作正常。

The file is correctly saved in UTF-8 and the Utf 8 Charset is also set in Header of the Main.php and the same aplies for the DB. 该文件以UTF-8正确保存,Utf 8 Charset也在Main.php的Header中设置,并且DB的相同配置也是如此。

Has anyone an idea for a solution? 有没有人想出一个解决方案? Many thanks in advance for your support! 非常感谢您的支持!

Check the 检查

Apache configuration (in httpd.conf or .htaccess)

Whether its UTF8 or Windows 1252 无论是UTF8还是Windows 1252

AddDefaultCharset utf-8 PHP (in php.ini) AddDefaultCharset utf-8 PHP(在php.ini中)

default_charset = "utf-8"
mbstring.internal_encoding=utf-8
mbstring.http_output=UTF-8
mbstring.encoding_translation=On
mbstring.func_overload=6

also use mb_detect_encoding for debugging to check where the data gets currupted 还可以使用mb_detect_encoding进行调试,以检查数据被破坏的位置

http://php.net/manual/en/function.mb-detect-encoding.php http://php.net/manual/en/function.mb-detect-encoding.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM