Page 1 of 1

Trying to read tags and output UTF-8

Posted: Wed Nov 21, 2007 1:53 pm
by fivenote
I'm having trouble rendering some characters read from id3v2 tags (title) in my web page. The tags are generated by ITunes v7.0.2. I'm using getid3 v2.0.0-b4.

I've set the following as suggested...

getid3->encoding ='UTF-8';
header("Content-type: text/html; charset=utf-8");
$info = getid3->Analyze($myFile);

Characters such as em-dash and spanish accents appear on the page as ??. php's mb_detect_encoding() confirms the string's encoding is UTF-8.

The only way I'm able to display the strings is to run it through MultiByteCharString2HTML() from v1.7.7. That seems able to convert the multi-byte sequences to HTML entities. This is a short-term solution since I'll soon have mp3 files tagged in many languages.

A sample file can be found at ... 215_07.mp3.

How can I read these tags so they'll render properly in the page?

Posted: Wed Nov 21, 2007 8:58 pm
by fivenote
Corrected link to sample file... ... 215_07.mp3

Also, here's a fiel with Spanish accents... ... 215_05.mp3