UTF-8 data corruption due to use of id3v1

alaa - July 3, 2007 - 15:18
Project:Audio
Version:5.x-2.x-dev
Component:audio_getid3
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

when using audio_getid3.module any UTF-8 data used in tags (artist and title) gets lost after submit. I hunted this down and the problem is due to audio_read_id3tags() reading id3v1 tags instead of id3v2

attached a trivial path that retains unicode tags.

also check
http://drupal.org/node/140982

AttachmentSize
audio_getid3-module-unicode.patch418 bytes

#1

drewish - July 20, 2007 - 00:55
Status:patch (code needs review)» patch (code needs work)

the only problem with this is that it only works when there's both v1 and v2. if there's only v2 then you'll load nothing. array_pop($value) might be a better way to go.

#2

drewish - July 20, 2007 - 01:20
Status:patch (code needs work)» fixed

i'm going to apply the attached patch to HEAD and DRUPAL-5. i think it's a cleaner way to do it. re-open this if it doesn't work for you.

AttachmentSize
audio_getid3_156476.patch872 bytes

#3

alaa - July 20, 2007 - 02:02
Status:fixed» patch (code needs work)

yes much cleaner, but there is a mistake in your patch, you do

<?php
foreach (array('id3v1', 'id3v1') as $format) {
...
}
?>

you need to change the second 'id3v1' to 'id3v2' I suppose.

#4

drewish - July 20, 2007 - 14:44
Status:patch (code needs work)» fixed

right you are. and i'd even tested that :( committed the attached patch.

AttachmentSize
audio_getid3_156476_0.patch704 bytes

#5

yngens - August 2, 2007 - 00:14

this works great, except that non-English names contain no links. i.e. they are now displayed correctly, but it is not possible to list all the songs with similar names or performers' names.

second problem is that non-English characters do not display on players (see XSPF Web Music Player - Slim or XSPF Web Music Player)

#6

drewish - August 2, 2007 - 01:56

non-English names contain no links. i.e. they are now displayed correctly, but it is not possible to list all the songs with similar names or performers' names.

i'm not sure what you mean? can you elaborate? though i wonder if you ran into a bug i've already fixed... you should make sure you're running the latest release. you may need to re-save those nodes.

sorry, can't do anything about the XSPF player.

#7

yngens - August 2, 2007 - 04:43

On a page of an audio-file there are such several categories under the player as: artist, title, album, genre, etc and it is possible to list all the songs of the same artist, genre or of the common song name.

For instance, if an audio file with the name "forever" has this link for the title:

http://www.domain.us/audio/by/title/forever

but a song with a name "Навсегда" (Cyrillic) for the same category (title) has:

http://www.domain.us/audio/by/title/

#8

alaa - August 2, 2007 - 07:36

this may be caused by another bug (should have reported it but I was too lazy) the function audio_clean_tag which is used to normalize info like artist name, song title and album name replaces all non latin unicode bytes with underscores.

I had to comment it out in order for audio to work with Arabic letters.

the flash player fails to show unicode char, but that's not a bug in audio module.

#9

yngens - August 2, 2007 - 08:59

alaa, what should i exactly need to do in order to get list songs with Cyrillic tags?

#10

drewish - August 2, 2007 - 14:12

alaa wrote:

this may be caused by another bug (should have reported it but I was too lazy) the function audio_clean_tag which is used to normalize info like artist name, song title and album name replaces all non latin unicode bytes with underscores.

yeah, i think that's the cause... i already said as much in #6:

though i wonder if you ran into a bug i've already fixed... you should make sure you're running the latest release. you may need to re-save those nodes.

#11

yngens - August 2, 2007 - 15:16

drewish, re-saving doesn't help. i did re-save several different nodes for several times. UTF8 names read perfectly, but show empty links.

#12

drewish - August 2, 2007 - 16:25

snegny, can you copy the first two lines from your audio.module file for me? it should look something like:

<?php
// $Id: audio.module,v 1.123 2007/08/01 18:51:49 drewish Exp $

#13

yngens - August 2, 2007 - 23:42

they are

<?php
// $Id: audio.module,v 1.105.2.10 2007/07/31 03:20:30 drewish Exp $

i downloaded the module just yesterday

#14

yngens - August 5, 2007 - 17:18
Status:fixed» active

sorry guys, but this has not really be solved for non-English characters. it displays n.E. letter correctly, but links work not correctly. so i am changing status of the thread back to active.

#15

drewish - October 22, 2007 - 21:10

marked http://drupal.org/node/185657 as a duplicate

#16

drewish - October 26, 2007 - 15:32

marked http://drupal.org/node/186801 as a duplicate

#17

mediafrenzy - October 26, 2007 - 22:01

I'm using 5.x-1.3 audio module.

So to fix the iTunes mp3 / ID3 question mark issue I'm having, should I be applying this patch ?

http://drupal.org/node/156476#comment-277431

Or will I have to upgrade further to 5.x-2.x-dev??

#18

drewish - October 30, 2007 - 02:45

whoops, i'd marked a bunch of issues as a duplicate of this... it should have been: http://drupal.org/node/145117

#19

taron13 - July 14, 2008 - 09:48

So what's the status on this fix? Does it even work for 5.x-1.4?

Thanks.

I started bugging my hoster because of this =)

 
 

Drupal is a registered trademark of Dries Buytaert.