Trying to read tags and output UTF-8

Locked
fivenote
User
Posts: 3
Joined: Wed Nov 21, 2007 1:31 pm

Trying to read tags and output UTF-8

Post by fivenote » Wed Nov 21, 2007 1:53 pm

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);
print($info['tags']['id3v2']['title'][0]);

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 http://download.jw.org/files/audio_maga ... 215_07.mp3.

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

fivenote
User
Posts: 3
Joined: Wed Nov 21, 2007 1:31 pm

Post by fivenote » Wed Nov 21, 2007 8:58 pm

Corrected link to sample file...

http://download.jw.org/files/media_maga ... 215_07.mp3

Also, here's a fiel with Spanish accents...

http://download.jw.org/files/media_maga ... 215_05.mp3

Locked