note 47596 deleted from ref.iconv by sean
| From: | sean@php.net | Date: | Mon, 22 Nov 2004 15:28:52 +0000 |
| Subject: | note 47596 deleted from ref.iconv by sean | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-80874@lists.php.net to get a copy of this message | ||
Note Submitter: jraxis.com <--at-- webmaster
----
Changing the name of this function to libiconv() is an incredibly Bad Idea -- it makes code that
works perfectly under one PHP installation fail completely when moved to a different host for
(apparently) no reason. It took me a fair bit of time to figure out why code that worked locally was
failing on my hosting provider's box due to iconv() being undefined, and yet phpinfo() was
showing iconv installed in both places.
That said, here's a workaround I'm using on my site:
<?php
function rax_iconv( $from, $to, $string ) {
if( function_exists( 'iconv' ))
return( iconv( $from, $to, $string ));
if( function_exists( 'libiconv' ))
return( libiconv( $from, $to, $string ));
return( FALSE );
};
?>
----
Reason: useless note