Re: strange character

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hadi wrote:

> Im trying to use (iconv("UTF-8", 'CP1256//TRANSLIT', $rss);) to convert
> strange character like (–) to proper character, but im getting error
> 
> I googled about it but never found anything about it.
> 
> Here is the error
> 
> Notice: iconv(): Detected an illegal character in input string in
> /var/www/html/rssfeed/sahafah.php on line 35 

Well, apparently these characters are invalid UTF-8 sequences, so trying
to convert them to another character encoding is likely to fail.

I'm not aware of a PHP function to strip invalid UTF-8 sequences that is
built-in to PHP or one of the common extensions, but there are userland
solutions available, for instance, utf8_bad_strip()[1].

[1]
<http://phputf8.cvs.sourceforge.net/viewvc/phputf8/utf8/utils/bad.php?view=markup&pathrev=MAIN>

-- 
Christoph M. Becker


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux