Codeigniter Character Encoding Issues

I have some simple pages that do not have database data and only statically load from the controller. I installed everything possible for UTF-8 encoding. I checked the headers that result in UTF-8 . However, he still parses the incorrect readings of these characters:.

controller

 function index(){ $this->load->view('french/header_view'); $this->load->view('french/homepage_view'); $this->load->view('french/footer_view'); } 

Configuration file :

 $config['charset'] = "UTF-8"; 

View Header :

 <? header("Content-Type: text/html; charset=UTF-8"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> .... 

Symbols used in body representation :

géniales - à - époustouflant

Symbols generated :

se g niales!

Where am I wrong? Thank you for your help!

+7
php codeigniter character-encoding
source share
3 answers

It seems that the data is not encoded in UTF-8. Have you checked the encoding settings of your editor?

+8
source share
+1
source share

I had the same issue with Dreamweaver CS4, but I fixed it with Notepad ++ (FREE!).

1.- Use Notepad ++ → Format → Convert to UTF-8 without specification.

2.- Save.

3.- REVIEW again the file and the correct characters that are displayed incorrectly.

4.- Save again.

5.- Everything is ready.

(Also make sure you have UTF8 in the configuration file in CI).

For me, at least it worked (Spanish).

0
source share

All Articles