iconv: is it a bug or my stupid head?
| From: | Ilja Polvanovas | Date: | Sun, 13 Apr 2003 20:26:26 +0000 |
| Subject: | iconv: is it a bug or my stupid head? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-143692@lists.php.net to get a copy of this message | ||
Platform: Debian Linux, 2.4.19
PHP: 4.2.3
i make a cycle to convert all rows to UTF-8 in MySQL database.
For example (simplified):
----------------------------------------------------------------------------
$result = mysql_query("SELECT id, text_field FROM mytable");
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)){
echo $row["text_field"] . "<br>";
echo iconv("Windows-1257", "UTF-8", $row["text_field"]) .
"\n";
}
----------------------------------------------------------------------------
the problem is that iconv returns normal string plus few lines of crap. This
crap differs from time to time even on same input strings. It seems to me
that it read's some additional memory blocks. So is it possible to be ? or i
make some mistake somewhere? Have anybody seen somthing similiar?
Thanks.