note 47596 added to ref.iconv
| From: | jraxis.com | Date: | Mon, 22 Nov 2004 15:14:22 +0000 |
| Subject: | note 47596 added to ref.iconv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-80867@lists.php.net to get a copy of this message | ||
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 );
};
?>
----
Manual Page -- http://www.php.net/manual/en/ref.iconv.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47596
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47596&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47596&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47596&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47596&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47596&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47596&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47596&report=yes
Search -- http://master.php.net/manage/user-notes.php