bugGNUpod - Bugs: bug #27570, Error in Unicode...

 
 

bug #27570: Error in Unicode album/artist/title name

Submitted by:  None
Submitted on:  Thu 01 Oct 2009 07:22:54 AM UTC  
 
Category: Adding songsSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 19 Oct 2009 04:27:31 PM UTC, comment #2:

Taking another look at your patch it seems quite clear that your mp3 tags are very broken..

You test for "(ord(substr($s,0,1))==3)" so i guess your mp3files are that way. Very strange.

> if (substr($s,$l/2,1)!="/" ||

substr($s,$l/2-1,1)!=" " ||
substr($s,$l/2+1,1)!="/")

This will always match except for when you you happen to
have " //" as separator exactly in the middle of your string.

It doesn't take into account that there could be more than one unicode character in the first part of the string and that the first and second part of the string therefore could be of rather different length.

and so on ..

I suggest you get your mp3tags fixed instead of patching gnupod. In the long run you will be happier.

Heinrich Langos <hlangos>
Project Administrator
Thu 15 Oct 2009 09:22:09 AM UTC, comment #1:

Hi,

I don't quite understand the problem.

Is it that you have your mp3 files inconsistently tagged or
is there a bug in the way that gnupod handles unicode in tags?

Heinrich Langos <hlangos>
Project Administrator
Thu 01 Oct 2009 07:22:54 AM UTC, original submission:

Unicode:
Bad naming of 'unicode' albums/artists/title, gets say a dual album name like ">Øvli / Oevli"
and causes breakup of album into many parts.

Fix: fix strings by calling FixUnicode, see diff below

diff /usr/local/bin/gnupod_addsong.pl gnupod_addsong3.pl

96a97,127

> sub trim {
> my $string = shift;
> $string =~ s/^\s+//;
> $string =~ s/\s+$//;
> return $string;
> }
>
> sub FixUnicode {
> my $s = shift;
> my $l=length($s);
> # print "\ntrying to fix <$s>, of lenght $l <".ord(substr($s,0,1)).">";
>
> if ($l<=1) {
> print "\nWARNING: expected string of lenght len >= 1 (s=<$s>)";
> }
> else {
> if (ord(substr($s,0,1))==3){
> #if ($l%2!=0) {
> # print "\nWARNING: expected string of lenght mod 2==0 (s=<$s>)";
> #}
> if (substr($s,$l/2,1)!="/" || substr($s,$l/2-1,1)!=" " || substr($s,$l/2+1,1)!="/") {
> print "\nWARNING: expected ' / ' in mid-string (s=<$s>)";
> }
>
> # print "\nreturning substring of size ".$l/2-2;
> #return substr($s,0,$l/2-1);
> return trim(substr($s,$l/2+2));
> }
> }
> return $s;
> }
>

203a238,241

> $fh->{artist}=FixUnicode($fh->{artist});
> $fh->{album}=FixUnicode($fh->{album});
> $fh->{title}=FixUnicode($fh->{title});
>

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hlangos (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 19 Oct 2009 04:27:31 PM UTChlangosOpen/ClosedOpen=>Closed
      StatusNeed Info=>Invalid
    Thu 15 Oct 2009 09:22:09 AM UTChlangosStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1