note 88893 added to function.iconv

From: Date: Thu, 12 Feb 2009 11:20:29 +0000
Subject: note 88893 added to function.iconv
Groups: php.notes 
Request: Send a blank email to php-notes+get-150565@lists.php.net to get a copy of this message
I noticed that iconv might return not entire string, and no error. It happens when iconv encounters characters it doesn't know how to convert to certain encoding. Simplest way to check how it works is: <?php $text=iconv('utf-8','iso-8859-2',$text); $text=iconv('utf-8','iso-8859-2',$text); ?> the result will be $text till first encounter of iso-8859-2 -specific char (such as ą / ź which already was converted to ± / Ľ ). It's quite hard to catch this error and brings a lot of trouble. I got it with converting greek alpha into iso-8859-2 (should be &alpha; but causes the error) ---- Server IP: 82.177.164.100 Probable Submitter: 78.8.137.39 ---- Manual Page -- http://www.php.net/manual/en/function.iconv.php Edit -- https://master.php.net/note/edit/88893 Del: integrated -- https://master.php.net/note/delete/88893/integrated Del: useless -- https://master.php.net/note/delete/88893/useless Del: bad code -- https://master.php.net/note/delete/88893/bad+code Del: spam -- https://master.php.net/note/delete/88893/spam Del: non-english -- https://master.php.net/note/delete/88893/non-english Del: in docs -- https://master.php.net/note/delete/88893/in+docs Del: other reasons-- https://master.php.net/note/delete/88893 Reject -- https://master.php.net/note/reject/88893 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#150565) next »