Welcome Guest, Not a member yet? Register   Sign In
CI 2.0 and UTF-8 strings
#2

[eluser]Arjen van Bochoven[/eluser]
I had the same problem and narrowed it down to iconv not working correctly. Passing a correct utf-8 string into
Code:
iconv('UTF-8', 'UTF-8//IGNORE', $str)
results in an empty string

I use MAMP 1.9.5 and filed a bug report. I can confirm the issue is not present in MAMP 1.7.1

The correct way to work around this is to extend the core class with your own as described in
Creating Core System Classes

* Create a new file: application/core/MY_Utf8.php
* Copy/paste the code below

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Utf8 extends CI_Utf8 {
    
    // --------------------------------------------------------------------

    /**
     * Overload for clean string for environments with
     * an incorrect iconv
     *
     * @access    public
     * @param    string
     * @return    string
     */
    function clean_string($str)
    {
        return $str;
    }

}


Messages In This Thread
CI 2.0 and UTF-8 strings - by El Forum - 03-16-2011, 03:59 PM
CI 2.0 and UTF-8 strings - by El Forum - 04-07-2011, 02:27 AM
CI 2.0 and UTF-8 strings - by El Forum - 04-07-2011, 02:42 AM
CI 2.0 and UTF-8 strings - by El Forum - 04-07-2011, 11:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB