Hi,

This problem is due to id3lib which contains a bug when writing some characters to Unicode. The initial bug description is on : http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979

In the last version 1.99.12 of id3lib, was added a check when writing the tag, to detect if your version of id3lib wasn't patched.
Here is attached the recommended patch.

Regards,
Jerome



Javier Kohen wrote, the 18/12/2005 01:17 :
Package: easytag
Version: 1.99.10-1
Severity: normal

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I just hit a bug with some Czech songs. For instance, character � (composed 
with 'y) cannot be saved properly by EasyTAG when using the recommended 
encoding setting (ISO-8859-1, or UNICODE fallback). The character shows up in 
the ID3v2 tag as FFFD (invalid UTF-16 sequence).

This might be related to bugs #281255 and #246856, but I'm not sure. There is 
some background information there. I guess that the cause behind the bug is 
that Debian still lacks an UTF-8-clean libid3, as mentioned elsewhere by Jerome 
and me. If this is not the case, I'd be happy to check this bug.


--
EasyTAG - Tag editor for MP3 and Ogg Vorbis files
http://easytag.sourceforge.net
--
Jerome COUDERC <[EMAIL PROTECTED]>

diff -ruN id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog
--- id3lib-3.8.3.orig/ChangeLog 2003-03-02 01:23:00.000000000 +0100
+++ id3lib-3.8.3/ChangeLog      2006-02-22 00:33:59.946214472 +0100
@@ -1,3 +1,8 @@
+2006-02-17  Jerome Couderc
+
+    * Patch from Spoon to fix UTF-16 writing bug
+      
http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
+
 2003-03-02 Sunday 17:38   Thijmen Klok <[EMAIL PROTECTED]>
 
        * THANKS (1.20): added more people 
diff -ruN id3lib-3.8.3.orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
--- id3lib-3.8.3.orig/src/io_helpers.cpp        2003-03-02 01:23:00.000000000 
+0100
+++ id3lib-3.8.3/src/io_helpers.cpp     2006-02-22 00:35:02.926639992 +0100
@@ -363,11 +363,22 @@
     // Write the BOM: 0xFEFF
     unicode_t BOM = 0xFEFF;
     writer.writeChars((const unsigned char*) &BOM, 2);
+    // Patch from Spoon : 2004-08-25 14:17
+    //   
http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
+    // Wrong code
+    //for (size_t i = 0; i < size; i += 2)
+    //{
+    //  unicode_t ch = (data[i] << 8) | data[i+1];
+    //  writer.writeChars((const unsigned char*) &ch, 2);
+    //}
+    // Right code
+    unsigned char *pdata = (unsigned char *) data.c_str();
     for (size_t i = 0; i < size; i += 2)
     {
-      unicode_t ch = (data[i] << 8) | data[i+1];
+      unicode_t ch = (pdata[i] << 8) | pdata[i+1];
       writer.writeChars((const unsigned char*) &ch, 2);
     }
+    // End patch
   }
   return writer.getCur() - beg;
 }

Reply via email to