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
| Attachment | Size |
|---|---|
| audio_getid3-module-unicode.patch | 418 bytes |

#1
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
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.
#3
yes much cleaner, but there is a mistake in your patch, you do
<?phpforeach (array('id3v1', 'id3v1') as $format) {
...
}
?>
you need to change the second 'id3v1' to 'id3v2' I suppose.
#4
right you are. and i'd even tested that :( committed the attached patch.
#5
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
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
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
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
alaa, what should i exactly need to do in order to get list songs with Cyrillic tags?
#10
alaa wrote:
yeah, i think that's the cause... i already said as much in #6:
#11
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
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
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
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
marked http://drupal.org/node/185657 as a duplicate
#16
marked http://drupal.org/node/186801 as a duplicate
#17
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
whoops, i'd marked a bunch of issues as a duplicate of this... it should have been: http://drupal.org/node/145117
#19
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 =)