#31314 [Opn->Bgs]: wrong translation
| From: | tony2001@php.net | Date: | Mon, 27 Dec 2004 18:40:04 +0000 |
| Subject: | #31314 [Opn->Bgs]: wrong translation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-71138@lists.php.net to get a copy of this message | ||
ID: 31314
Updated by: tony2001@php.net
Reported By: yury at gorodok dot net
-Status: Open
+Status: Bogus
Bug Type: ICONV related
Operating System: Windows
PHP Version: 5.0.2
New Comment:
You have mbstring.func_overload turned On, thus strlen() returns number
of characters, not bytes.
Turn it off or just don't use third parameter of fwrite().
Previous Comments:
------------------------------------------------------------------------
[2004-12-27 18:24:32] yury at gorodok dot net
Description:
------------
The code must translate UTF-8 to windows-1251,
but it truncates output!
May be old compiled in version of libiconv?
examples follow:
UTF-8:
http://yury.gorodok.net/temp/test_.html
result:
http://yury.gorodok.net/temp/test_1.html
(the content is not essential, I suppose)
Reproduce code:
---------------
$fstr=fread($f, $flen);
$ffstr=iconv( "windows-1251", "UTF-8",$fstr);
echo fwrite($ff,$ffstr, strlen($ffstr))."\n";
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31314&edit=1