Error in accents and 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 Laval 13.04.2017 в 09:51
source

1 answer

0

If you have configured this:

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

I do not think you have problems since sometimes it is the reader or viewer that you have and if in that case you print it directly on the screen without a view I mean no HTML structure that has a header with > UTF-8 so it's normal to leave it that way, try getting that information and show it in a view with "UTF-8".

    
answered by 13.04.2017 в 19:21