|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-02-11 08:40 UTC] cpuidle at gmx dot de
Description:
------------
Trying simple charset conversion with iconv:
iconv('iso-8859-1', 'utf-8', 'test');
receive this error:
Notice: iconv() [function.iconv]: Wrong charset, conversion from `ISO8859-1' to `UTF-8' is not allowed in /var/htdocs/test.php on line 5
Problem: no troubleshooting information available, e.g. list or supported charsets or similiar.
How can this be diagnosed?
Reproduce code:
---------------
error_reporting(E_ALL);
$res = iconv('iso-8859-1', 'utf-8', 'test');
Expected result:
----------------
No error and/or supporting functions to aid diagnostics.
Actual result:
--------------
Error message:
Notice: iconv() [function.iconv]: Wrong charset, conversion from `ISO8859-1' to `UTF-8' is not allowed in /var/htdocs/test.php on line 5
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 02:00:01 2025 UTC |
I have the same problem in php 5.2.5. My code: iconv('iso-8859-2', 'utf-8', 'test');Notice: iconv() [function.iconv]: Wrong charset, conversion from `ISO-8859-1' to `UTF-8//TRANSLIT' is not allowed in /var/www/test.php on line 7 Same here with libapache2-mod-php5.2.6 on my debian etch based system. I first thought it has to do with my chroot-setup and spent 2 days searching what goes wrong and found nothing. It works fine with an old php4-binary, iconv directly called in the shell works too. samples from ANSI encoded file: echo iconv('UTF-8', 'ASCII//TRANSLIT', "test"); // works echo iconv('ASCII', 'UTF-8//TRANSLIT', "test"); // works echo iconv('UTF-8', 'ISO-8859-1//TRANSLIT', "test"); // works not echo iconv('ISO-8859-1', 'UTF-8//TRANSLIT', "test"); // works not