Difference between #23 and #25 of
How to set up Unicode

Revision #25 has been created by Roman Solomatin on Feb 20, 2013, 3:09:26 AM with the memo:

Reformatted "PHP script files" paragraph.
« previous (#23) next (#26) »

Changes

Title unchanged

How to set up Unicode

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

i18n, unicode

Content changed

[...]
By default, Yii applications already suppose the character set is UTF-8. See [CApplication::charset](http://www.yiiframework.com/doc/api/1.1/CApplication#charset-detail). This is used for encoding text in HTML pages, e.g. by [CHtml::encode()](http://www.yiiframework.com/doc/api/CHtml/#encode-detail)

## 1. PHP script files ##

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 Example:
[...]
~~~

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 ##

You need to set to UTF-8 the encoding of your connection to the SQL server. It's recommended to set up every table in your database needs to use the same charset for its content, but if it's not the case, the SQL server will convert the text on-the-fly. So **this step isn't mandatory, but it's highly recommended**.

The configuration for that might differ between database systems.
[...]
19 0
14 followers
Viewed: 135 813 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: 10 years ago
Update Article

Revisions

View all history