Welcome Guest, Not a member yet? Register   Sign In
some utf8 problems... not all
#1

[eluser]Marc Arbour[/eluser]
Hello.

I have a new server and set ip up like I wanted. But there is something strange happening.

I have everything set on utf8 in config.php, in my views, my database...

Everything is wonderfull as accents show up everywhere but... in my $data variables...

In order to show up properly on my webpage, I need to change this
Code:
$data['page_title'] = 'Bienvenue à ';
into
Code:
$data['page_title'] = utf8_encode('Bienvenue à ');

Anyone has an idea on how to solve the problem or how to utf8_encode the whole $data array?

I did try couple of array_walk tests without any success.

Best regards

Marc
#2

[eluser]Sbioko[/eluser]
Use my Codeigniter 1.7.2 UTF-8 Edition and you will not need any magic with UTF8. You can find link to it in my signature.
#3

[eluser]Marc Arbour[/eluser]
Nope. THis didn't solve my problem.

Data from the database still with accents while data from $data variables still with "squared question marks"

Anyone else?
#4

[eluser]tomcode[/eluser]
Guess the file containing the $data declaration is not UTF-8.
#5

[eluser]sl3dg3hamm3r[/eluser]
The question might be silly, but are you sure you editor saved your files (controller, view) in UTF-8?
#6

[eluser]Marc Arbour[/eluser]
I checked against dreamweaver config to confirm my editor is set to utf8.

But when I cat my files in linux command line, they indeed seems as they were not properly encoded.

I checked options in my ftp software (webdrive) only to find an option for utf8 filenames only.

Anyone to suggest me a php editor for that will solve my problem?

Regards

Marc
#7

[eluser]sl3dg3hamm3r[/eluser]
Here you find a long discussion about plenty of editors...
#8

[eluser]Marc Arbour[/eluser]
ok, found a solution. But it's not totally sane to do this for all my files in all my sites.

After setting the BOM setting in dreamweaver, I was forced to do a file->new then paste the content of the "old" file and then "save as" overwriting the file.

My files are now utf8...

Does anybody know how I could "automate" this process for all files systematically in dreamweaver?

Marc
#9

[eluser]Sbioko[/eluser]
I worked in Dreamweaver 2 years ago, but today I use NetBeans or Notepad++.
Quote:Data from the database still with accents while data from $data variables still with “squared question marks”
You need to convert your database to utf8_general_ci and all you php scripts must be converted with "UTF-8 Without BOM". And(if you use my package) use(for example) utf8_strtolower instead of strtolower and all will be fine.




Theme © iAndrew 2016 - Forum software by © MyBB