Part of the EllisLab Network
   
2 of 2
2
BUG: UTF-8 does NOT work!
Posted: 08 May 2010 07:08 PM   [ Ignore ]   [ # 16 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5399
Joined  06-19-2009

The problem is the MySQL database, here is an example.

Create a new database with phpMyAdmin called test

Set the database collation to utf8_unicode_ci

Click create

Now you would think that that the database wa created with utf8_unicode_ci WRONG!

Now click on the top orerations tab and look at the collation on the bottom
it is set to latin1_swedish_ci

To fix it click the dropdown and change it to utf8_unicode_ci and click go.

Problem solved.

InsiteFX

 Signature 

Custom Designed Icons, eBook Covers Software Boxes. CD, DVD Etc. New iPhone® Tab Bar Icons and iPhone® Applications Icons.

STOP! Before posting your questions, remember the WWW Golden rule:
What did you try? What did you get? What did you expect to get?

Input -> Controller | Processing -> Model | Output -> View

Profile
 
 
Posted: 15 June 2010 03:20 AM   [ Ignore ]   [ # 17 ]  
Summer Student
Avatar
Total Posts:  3
Joined  05-03-2010
Buso - 08 May 2010 02:00 PM
AzizLight - 02 March 2010 04:05 PM

Can anyone confirm what I am saying, and help me solve the problem please?

no, sorry.. I always used utf-8 and never had a problem with CI

Hi all,

I am newbie to Codeigniter so I faced same problem with UTF-8 where using Persian string to insert into database. At first I got something wrong output. But after checking my file headers I have missed header issue. e.g.
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />

This line of code solved all utf-8 unicode text.

Thanks,
Nasir Gulzade

Profile
 
 
Posted: 21 September 2010 02:20 AM   [ Ignore ]   [ # 18 ]  
Summer Student
Total Posts:  2
Joined  09-21-2010

I’ve found a solution to a similar problem. I’ve tried setting headers and adding meta, none of it solved the problem.

Change dbcollat to none. This is what works for me.

$db['default']['char_set''utf8';
$db['default']['dbcollat'''
Profile
 
 
Posted: 02 March 2011 04:53 PM   [ Ignore ]   [ # 19 ]  
Summer Student
Avatar
Total Posts:  1
Joined  03-02-2011
AzizLight - 02 March 2010 04:05 PM

Can anyone confirm what I am saying, and help me solve the problem please?

Well, I have struggled with the same problem a day or two - and solved it! However, it might be that we had the same symptoms for different problems.

I have tried to follow http://philsturgeon.co.uk/news/2009/08/UTF-8-support-for-CodeIgniter but it didn’t help me.

I traced the problem to the loading of data to a mysql server from a local SQL-source file. The trick, for me, is to explicitly start my local mysql terminal program with the flag —default-character-set=utf8 when loading the data to the web server. Something like this:

terminalmysql --default-character-set=utf8  -u user -h host -source.sql 

More info at:
http://dev.mysql.com/doc/refman/5.0/en/batch-commands.html

n.b. Code Igniter apparently handles UTF8 fine wink  ... for me and my Swedish “dots”

Profile
 
 
Posted: 20 May 2011 10:27 PM   [ Ignore ]   [ # 20 ]  
Summer Student
Avatar
Total Posts:  21
Joined  04-14-2011

I am also fetching the same problem. I tried everything that you all told here but no result.

I am fetching the problem when i am atempting preg_replace for this character

à

It generates some kind of “

 Signature 

Manas Bala
Codeigniter Developer

Profile
 
 
   
2 of 2
2