Difference between #35 and #37 of
How to set up Unicode

Changes

Title unchanged

How to set up Unicode

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

i18n, unicode

Content changed

[...]
## 1. PHP script files ##

Every text file is stored in a specific character set on disk. For your PHP files this must be UTF-8 charset **without [BOM](http://en.wikipedia.org/wiki/Byte_order_mark)**. Make sure to use an editor which is capable of Unicode. If you have some older non-unicode files in your project open them with your editor and save them again UTF-8 encoded.

> Tip: On Windows you can for example use [`Notepad++`](http://notepad-plus-plus.org/ "Notepad++"), which has a
n `Encoding` menu from where you can change encodings of your files.

On Linux you can also use command line tools like `recode` or `iconv` to convert a whole bunch of files. Here's a script that converts every php file in the directory `myproject/` and its sub-directories:
[...]
~~~

>Note: Unfortunately it's not recommended to set this
ain an `.htaccess` file as this may lead to undefined behavior.

## 3. Database ##
[...]
~~~

###
nNginx

The right `Content-Type` header is set with this directive:
[...]
~~~
server {
charset
utfUTF-8;
...
}
~~~

### PHP alternative
[...]
19 0
14 followers
Viewed: 138 250 times
Version: 1.1
Category: How-tos
Tags: i18n, unicode
Written by: Mike
Last updated by: Roman Solomatin
Created on: Feb 21, 2009
Last updated: 11 years ago
Update Article

Revisions

View all history