Search code examples
phpcodeigniterutf-8quotes

Codeigniter curly quotes (despite UTF-8 collation)


I'm using a simple form to write string to database, but the curly quotes (on retrieval) are being displayed as special characters.

So far I have tried changing the table collation to UTF-8 as well as using the CodeIgniter Typography class:

 1. alter table test.vocab convert to character set utf8 collate
    utf8_unicode_ci;
 2. $this->load->library('typography'); 
    $data['item'] = $this->typography->auto_typography($data['item'], FALSE);

This hasn't helped, though. Here's what the output looks like:

enter image description here

If needed I'll post more code. Please help.


Solution

  • Thank you everyone, but it seems like what I needed was the mb_convert_encoding() function:

    $i['item'] = mb_convert_encoding($i['item'], 'HTML-ENTITIES', 'UTF-8');
    

    Many thanks for taking out the time for commenting or answering.