Edit report at http://bugs.php.net/bug.php?id=44096&edit=1

 ID:               44096
 Comment by:       icovt at yahoo dot com
 Reported by:      cpuidle at gmx dot de
 Summary:          iconv: wrong charset
 Status:           No Feedback
 Type:             Bug
 Package:          ICONV related
 Operating System: WinXP
 PHP Version:      5.2.5

 New Comment:

mod_php iconv() is not working properly if your apache is chrooted and
you do not 

have the content of /usr/lib/gconv/ folder into your relative chroot
path (i.e. 

/your/chroot/path/usr/lib/gconv/). 

You can simply do: 

cp /usr/lib/gconv/* /your/chroot/path/usr/lib/gconv/

... and re-try.



This was a fix for me, hope this could save time for somebody else.



P.S. Btw, initially iconv() called from command line (using php cli) was
OK.


Previous Comments:
------------------------------------------------------------------------
[2009-03-10 13:31:55] cancausecancerr at yahoo dot com dot cn

I found my problem. It was 'utf8' vs. 'utf-8'. 



I peeked inside Zend Lucene Lucene's code and saw it was looking for
'utf8' or 'utf-8' so I thought I'd save a byte and take 'utf8' (shakes
fist at Zend then at self:: for being cheap). 



I echo'd out what Zend Lucene was populating the iconv() with and that's
where I saw my prob.



As for the reason my english data wasn't raising this error, I indexed
those tables with 'utf-8'.



So it seems my error was the same as everyone elses (encoding type
didn't exist on my systema)

------------------------------------------------------------------------
[2009-03-10 12:58:53] cancausecancerr at yahoo dot com dot cn

I got the error while querying a lucene index I just created from a
mysql utf8 table (populated with danish data). When I created the index
I used 'utf8' while adding fields so everything should be fine. I don't
get the error when I query my other tables which have english data and
were created in exactly the same manner.



Notice: iconv() [function.iconv]: Wrong charset, conversion from `utf8'
to `ASCII//TRANSLIT' is not allowed in
Z:\Zend\Search\Lucene\Analysis\Analyzer\Common\Text.php on line 57



Windows NT 5.1 build 2600

Apache/2.2.4

MySQL 5.1.22-rc-community

PHP Version 5.2.6



PHPINFO ICONV:

iconv support   enabled

iconv implementation    "libiconv"

iconv library version   1.11



Directive       Local Value     Master Value

iconv.input_encoding    ISO-8859-1      ISO-8859-1

iconv.internal_encoding ISO-8859-1      ISO-8859-1

iconv.output_encoding   ISO-8859-1      ISO-8859-1

------------------------------------------------------------------------
[2009-02-26 06:25:15] aboh24 at gmx dot de

Same problem on Solaris 10 and explicit compiled and  linked
libiconv-1.12 and php 5.2.8. with --with-iconv-dir=<path to
libiconv-1.12 lib>



PHP Notice:  iconv(): Wrong charset, conversion from `UTF-8' to
`ASCII//TRANSLIT' is not allowed in /sisis/home/sisis/suchopac/query.php
on line 39

PHP Notice:  iconv(): Wrong charset, conversion from `ASCII' to
`UTF-8//TRANSLIT' is not allowed in /sisis/home/sisis/suchopac/query.php
on line 40

PHP Notice:  iconv(): Wrong charset, conversion from `UTF-8' to
`ISO-8859-1//TRANSLIT' is not allowed in
/sisis/home/sisis/suchopac/query.php on line 42

PHP Notice:  iconv(): Wrong charset, conversion from `ISO-8859-1' to
`UTF-8//TRANSLIT' is not allowed in /sisis/home/sisis/suchopac/query.php
on line 43

------------------------------------------------------------------------
[2009-02-12 06:40:47] niloat at gmail dot com

Please check whether necessary so files exists in /usr/lib/gconv.

You can copy those files from other's linux system if missing someone.

------------------------------------------------------------------------
[2008-05-13 05:11:40] iconv dot 20 dot cheef-daniel at spamgourmet dot
com

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

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=44096


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=44096&edit=1

Reply via email to