Welcome Guest, Not a member yet? Register   Sign In
Codeigniter Character Encoding Issues
#1

[eluser]eiso[/eluser]
Fixed: I had to change the physical way the files were saved on the server to UTF-8


Dear CI Community,

I have a few simple pages which have no DB data, are just static loaded as following from the controller. I have set everything possible to UTF-8 - I have checked headers which result to UTF8 - however it still parses wrong (these characters: ���).

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

Part of my config file:

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

Part of my header view file:

Code:
<? 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">
&lt;html &gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt;
....


Characters used in body (which is a body view file):

Quote:géniales - à - époustouflant

Characters get shown as (also in html source):

Quote: � se g�niales !

Where have I gone wrong?

All the best,

Eiso


Dear CI Community,

I have a few simple pages which have no DB data, are just static loaded as following from the controller. I have set everything possible to UTF-8 - I have checked headers which result to UTF8 - however it still parses wrong (these characters: ���).

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

Part of my config file:

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

Part of my header view file:

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


Characters used in body (which is a body view file):

Quote:géniales - à - époustouflant

Characters get shown as (also in html source):

Quote: � se g�niales !

Where have I gone wrong?

All the best,

Eiso
#2

[eluser]TheFuzzy0ne[/eluser]
Wow, Deja-vu!

Could it be a database encoding issue, or is this data written straight into your view?




Theme © iAndrew 2016 - Forum software by © MyBB