Hello.
I had problem with CHtml::TextField - it should have shown expressions containing not only numbers and english characters, but also language-specific characters (czech republic). If these characters were present in TextField, than this TextField was blank - Yii did not fill it’s “value”. I solved it by changing function encode() in Yii framework. This function can be found in file: yii/framework/web/helpers/Chtml.php. It’s original content was this:
return htmlspecialchars($text,ENT_QUOTES,Yii::app()->charset);
and I changed it to return only the text:
return $text;
Everything worked well than.
In Yii is probably default and only value of Yii::app()->charset = UTF-8
I used "windows-1250" in layouts/main.php
In DB connection is set UTF-8 charset. (content of TextField came from DB)
UPDATE1:
Another solution was to change 3rd parameter of function htmlspecialchars(). Instead of Yii::app()->charset I entered ‘cp1251’ or ‘ISO-8859-1’. Maybe another charsets would work.
Is this solution OK? Can anyone pass judgment on it?