Error in accents Codeigniter Angular

0

When returning a result in Codeigniter and Angular the accents become

contrase\u00f1a
        ^^^^^^

How can I solve the error?

Code PHP Codeigniter

$this->output->set_content_type('application/json');
$this->output->set_output(json_encode($response));

Angular Code

$scope.ErrorMessage = data.message;

I have the following code:

function getMessage($key){
    $file = parse_ini_file('application/messages.properties');
    return $file[$key]; 
} 
    
asked by Andres Guillermo Castellanos A 03.08.2016 в 01:07
source

1 answer

0

This is due to the coding of the characters, if you want to put accents you must put the coding to UTF-8. To do that from php you have to modify the php.ini file. To do it in Angular it will be enough to put the meta tag html.

In this stackoverflow question you have a similar problem solved

link

    
answered by 03.02.2018 в 16:49