|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49575 iconv function fails if you try to convert one character set into the same set
Submitted: 2009-09-17 01:14 UTC Modified: 2009-09-25 01:00 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: me at mikearsenault dot com Assigned:
Status: No Feedback Package: ICONV related
PHP Version: 5.2SVN-2009-09-17 (SVN) OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: me at mikearsenault dot com
New email:
PHP Version: OS:


 [2009-09-17 01:14 UTC] me at mikearsenault dot com
If you try to convert one character set into the same character set using this function, it causes a 500 internal server error that shows up in the logs as:

[error] [client XXX.XXX.XXX.XXX] Premature end of script headers: myscript.php

Reproduce code:
$charset = "ISO-8859-1";

try {
  $i= iconv($charset, "ISO-8859-1", "123321ksdjvskjdfksdfbasbdaSDjhdb");
  echo $i;
catch (Exception $e) {
echo 'Caught exception: ',  $e->getMessage(), "\n";	

Expected result:

Actual result:
500 Internal Server Error


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-09-17 15:34 UTC]
Please try using this snapshot:
For Windows:

works fine for me.
 [2009-09-25 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 09:01:27 2023 UTC