suppress iconv() errors?

The place for "I can't figure out how to..." questions.
Post Reply
kpicon92
User
Posts: 1
Joined: Thu Apr 28, 2011 6:11 am
Are you a spambot?: no

suppress iconv() errors?

Post by kpicon92 » Thu Apr 28, 2011 6:20 am

Hi,
I'm using getID3 to fetch album art automatically in a music playing app. It works very well for this, however it throws this error quite frequently:

Code: Select all

iconv(): Detected an illegal character in input string in /home/picon/music/getid3/getid3.lib.php on line 902
It appears to happen specifically when the file being parsed has Asian characters somewhere in the metadata (I'm not 100% sure, but that seems to be the pattern). It doesn't prevent anything from working, but it's filling up my error log.
What would be the most logical solution to this problem?

Thanks!

James Heinrich
getID3() v1 developer
Posts: 1477
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: suppress iconv() errors?

Post by James Heinrich » Thu Apr 28, 2011 12:43 pm

What version of getID3?
What version of PHP?
Can you email/PM me a link to a sample file, please?

Squash
User
Posts: 2
Joined: Sun May 22, 2011 3:34 pm
Are you a spambot?: no

Re: suppress iconv() errors?

Post by Squash » Sun May 22, 2011 3:42 pm

James Heinrich wrote:What version of getID3?
What version of PHP?
Can you email/PM me a link to a sample file, please?
Hello James.

We have the same problem as described above. We have a lot of the same messages in server error_log file

Code: Select all

PHP Notice: iconv() [function.iconv]: Detected an illegal character in input string in /filesvn/svn.egwhite.eu/egwwritings.org/resources/classes/getid3/getid3.lib.php on line 902
define('GETID3_VERSION', '1.8.5-20110218');
PHP 5.3.5 (cli) (built: Mar 24 2011 07:17:54)
File for example: https://egwwritings.org/media/mp3/1800/ ... slovie.mp3

James Heinrich
getID3() v1 developer
Posts: 1477
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: suppress iconv() errors?

Post by James Heinrich » Mon May 23, 2011 3:19 am

The solution that will be included in v1.9.x will be adding the error-suppressing "@" in front of the call to iconv (line 902 in getid3.lib.php for v1.8.5, if you hadn't guessed):
if ($converted_string = @iconv($in_charset, $out_charset.'//TRANSLIT', $string)) {

Squash
User
Posts: 2
Joined: Sun May 22, 2011 3:34 pm
Are you a spambot?: no

Re: suppress iconv() errors?

Post by Squash » Mon May 23, 2011 11:36 am

James Heinrich wrote:The solution that will be included in v1.9.x will be adding the error-suppressing "@" in front of the call to iconv (line 902 in getid3.lib.php for v1.8.5, if you hadn't guessed):
if ($converted_string = @iconv($in_charset, $out_charset.'//TRANSLIT', $string)) {
Thanks. I already implemented this solutions, since @ symbol was here in previous version.

Post Reply