I was having issues with iconv on a production box.
public function encodeString($string, $charEncoding)
return iconv($charEncoding, 'CP1252//IGNORE', $string);
would fail with the error
Notice: iconv() [function.iconv]: Wrong charset, conversion from `UTF-8' to `CP1252//IGNORE' is not allowed
I had tested this on a WAMP server at our office and iconv worked fine.
I’ve tested again on the hosting providers server and the error occured
The problem was with the configuration on the production box.
Because the webserver is in a chroot environment all the libraries need to be also placed in the chroot so that php and apache can access them.
In this case the locale conversion libraries were not copied over.
To get iconv running, the gconv libraries need placing inside the chroot
**This is for a Debian Etch server, others may place gconv elsewhere**
cp -R /usr/lib/gconv /chroot/apache/usr/lib/
Thanks go to David from Inspire.net.nz for figuring this one out for me