Revision #27 has been created by François Gannaz on Feb 20, 2013, 8:21:02 AM with the memo:
protect file names, and do not promote root access (though `sudo su` was funny)
« previous (#26) next (#35) »
Changes
Title
unchanged
How to set up Unicode
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
i18n, unicode
Content
changed
[...]
Make sure that you use an editor which is capable of using UTF-8 and save all your files UTF-8 encoded without [BOM](http://en.wikipedia.org/wiki/Byte_order_mark). If you have some older non-unicode files in your project open them with your editor and save them again UTF-8 encoded.
On Linux you can also use command line tools like `recode` or `iconv` to convert a whole bunch of files.
For Eexample
, to convert every php file in the directory "myproject/" and its sub-directories:
~~~
[
bash]
$ cd
/var/www/myproject/
$
sudo su
# for i in $(find -name '*.php');
do encoding=$(file -bi
"$i
" | sed -e 's/.*[ ]charset=//'); iconv -f $encoding -t UTF-8 -o
"$i
" "$i
"; done
# exit
~~~
On Windows you can use application like [`Notepad++`](http://notepad-plus-plus.org/ "Notepad++"), which has `Encoding` menu from where you can change encodings of your files.
## 2. Database tables ##[...]