Skip Menu |

This queue is for tickets about the MP3-Tag CPAN distribution.

Report information
The Basics
Id: 32908
Status: open
Priority: 0/
Queue: MP3-Tag

People
Owner: Nobody in particular
Requestors: brian [...] Awfulhak.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.9709
Fixed in: (no value)



Subject: Setting MP3TAG_DECODE_UTF8=0 doesn't work
Using the following code snippet: BEGIN { # We expect utf-8 encoded filesystem names, so tell MP3::Tag not to # decode the tags. $ENV{MP3TAG_DECODE_UTF8} = 0; } I expect to be able to see utf8 strings, but instead see latin1 strings because Encode::encode('UTF-8', $found) is never called. I think the attached patch is correct - $encoding in my case is set to zero (the _encoding tag is read with a value of zero) but I wouldn't really expect that to stop the code from doing the UTF-8 encoding. If you have a better fix in mind but no time to implement it, I'm happy to do the work. Other details: I have LC_ALL=en_US.UTF-8. I use MP3::Tag to verify v1 tags against v2 tags against filesystem details under FreeBSD to keep my music collection tagged consistently. With the attached patch I can compare names such as Sinéad O'Connor/Sean-Nós Nua/10 Báidín Fheilimí.mp3 with the tags contained in the file. Cheers.
Subject: patch-ID3v2.pm
--- Tag/ID3v2.pm.orig 2008-01-30 01:41:48.000000000 -0800 +++ Tag/ID3v2.pm 2008-01-30 02:52:17.000000000 -0800 @@ -1773,7 +1773,7 @@ my ($self, $data, $format) = @_; my ($rule, $found,$encoding, $result, $e); - $encoding=0; + $encoding=$result->{encoding}; foreach $rule (@$format) { next if exists $rule->{v3name}; # get the data @@ -1808,10 +1808,10 @@ # decode data warn "Encoding type '$encoding' not supported: found in $rule->{name}\n"; next; - } elsif ($encoding and not $trustencoding) { + } elsif (defined $encoding and not $trustencoding) { warn "UTF encoding types disabled via MP3TAG_DECODE_UNICODE): found in $rule->{name}\n"; next; - } elsif ($encoding) { + } elsif (defined $encoding) { # 0 = latin1 (effectively: unknown) # 1 = UTF-16 with BOM # 2 = UTF-16be, no BOM
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #32908] Setting MP3TAG_DECODE_UTF8=0 doesn't work
Date: Sun, 3 Feb 2008 23:00:54 -0800
To: Brian Somers via RT <bug-MP3-Tag [...] rt.cpan.org>
From: Ilya Zakharevich <nospam-abuse [...] ilyaz.org>
On Mon, Feb 04, 2008 at 12:02:58AM -0500, Brian Somers via RT wrote: [Your MIME envelop is completely broken; decoded manually...] ============================================ Using the following code snippet: BEGIN { # We expect utf-8 encoded filesystem names, so tell MP3::Tag not to # decode the tags. $ENV{MP3TAG_DECODE_UTF8} = 0; } Is not it written there that MP3TAG_DECODE_UTF8 is not supported? It is there only for backward compatibility with old, broken, semantic. I expect to be able to see utf8 strings, but instead see latin1 strings because Encode::encode('UTF-8', $found) is never called. I think the attached patch is correct - $encoding in my case is set to zero (the _encoding tag is read with a value of zero) but I wouldn't really expect that to stop the code from doing the UTF-8 encoding. ============================================ I have no idea what you are talking about. Please state clearly what you want to achieve; then I might be able to help you. [E.g., if your frames mis-encoded as 0, then default-encoding options may usable...] Hope this helps, Ilya