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

[eluser]Unknown[/eluser]
Hi, I found the problem in validating text fields in form. Values just disappeared. Log message was:
Quote:ERROR - 2011-03-16 22:03:48 --&gt; Severity: Notice --&gt; iconv() [...] : Wrong charset, conversion from `UTF-8' to `UTF-8//IGNORE' is not allowed <path>/system/core/Utf8.php 89
So I checked Utf8.php and found this:
Code:
function clean_string($str)
    {
        if ($this->_is_ascii($str) === FALSE)
        {
            $str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);
        }

        return $str;
    }
Can someone tell me what is the purpose of cripling UTF-8 string? I choose UTF-8 because I need to deal with chars like "ąęźćż" and those are far beyond x7F (_is_ascii($str) check). For now I just commented out check and just return $str and problem is gone. Sorry for errors english isn't my native language.


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