php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43672 Linux fails with iconv("Shift_JIS", "Shift_JIS//TRANSLIT", $result);
Submitted: 2007-12-25 03:43 UTC Modified: 2008-01-28 23:57 UTC
From: parkinson at fm-net dot ne dot jp Assigned:
Status: Not a bug Package: ICONV related
PHP Version: 5.2.5 OS: Linux
Private report: No CVE-ID: None
 [2007-12-25 03:43 UTC] parkinson at fm-net dot ne dot jp
Description:
------------
iconv fails on linux when the encoding types are both Shift_JIS

looks a bit like Bug #38425, I agree with the comment:

"shouldn't the //TRANSLIT mode modify such behaviour and
allow the conversion to continue?"



Reproduce code:
---------------
Both of these fail on Linux but not windows:
$result = iconv("Shift_JIS", "Shift_JIS//TRANSLIT", $result);
$result = iconv("Shift-JIS", "Shift_JIS//TRANSLIT", $result);


$result contains the contents of this page:
http://www.seodayo.com/lint/htmllint.cgi?URL=http%3A%2F%2Fwww.e-food.jp%2F

the char it fail on is just after "<img src="./fight.gif" alt="


Expected result:
----------------
$result should be unchanged or contain valid Shift_JIS.

Actual result:
--------------
It returns part of $result, as if some char is causing it to stop processing.

i.e. the first 1000 bytes of $result are returned,the rest, around 6000 bytes, are missing.


the bytes where it stops have values
243, 164, 208 




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-28 23:57 UTC] tony2001@php.net
It's glibc/libiconv who returns the error.
We cannot fix or change that behavior.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 25 13:03:36 2021 UTC