View Issue Details

IDProjectCategoryView StatusLast Update
0002047libextractorpluginspublic2012-09-25 17:18
ReporterLRN Assigned ToLRN  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version0.6.3 
Target Version1.0.0Fixed in Version1.0.0 
Summary0002047: Non-standard-compliant id3v24 extractor
Descriptionhttp://www.id3.org/id3v2.4.0-structure defines the use of ISO-8859-1, UTF-8 and two UTF-16 (with different endianess) encodings, but the plugin only supports ISO-8859-1 and UCS-2, just like id3v23.
TagsNo tags attached.
Attached Files
0001-Use-the-right-encodings-as-per-id3v24-specs.patch (3,188 bytes)   
From 4296533a37eb3f03d43ec682d7f3e1a08ad52224 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1=D1?=
 =?UTF-8?q?=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= <lrn1986@gmail.com>
Date: Tue, 3 Jan 2012 03:03:26 +0400
Subject: [PATCH] Use the right encodings, as per id3v24 specs

---
 src/plugins/id3v24_extractor.c |   40 ++++++++++++++++++++++++++++++++++++----
 1 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/src/plugins/id3v24_extractor.c b/src/plugins/id3v24_extractor.c
index 9055a7b..301020c 100644
--- a/src/plugins/id3v24_extractor.c
+++ b/src/plugins/id3v24_extractor.c
@@ -221,7 +221,15 @@ EXTRACTOR_id3v24_extract (const unsigned char *data,
 		      break;
 		    case 0x01:
 		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 11],
-							       csize - 1, "UCS-2");
+							       csize - 1, "UTF-16");
+		      break;
+		    case 0x02:
+		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 11],
+							       csize - 1, "UTF-16BE");
+		      break;
+		    case 0x03:
+		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 11],
+							       csize - 1, "UTF-8");
 		      break;
 		    default:
 		      /* bad encoding byte,
@@ -256,7 +264,15 @@ EXTRACTOR_id3v24_extract (const unsigned char *data,
 		      break;
 		    case 0x01:
 		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + off],
-							       csize - off, "UCS-2");
+							       csize - off, "UTF-16");
+		      break;
+		    case 0x02:
+		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + off],
+							       csize - off, "UTF-16BE");
+		      break;
+		    case 0x03:
+		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + off],
+							       csize - off, "UTF-8");
 		      break;
 		    default:
 		      /* bad encoding byte,
@@ -278,7 +294,15 @@ EXTRACTOR_id3v24_extract (const unsigned char *data,
 		      break;
 		    case 0x01:
 		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 16],
-							       csize - 6, "UCS-2");
+							       csize - 6, "UTF-16");
+		      break;
+		    case 0x02:
+		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 16],
+							       csize - 6, "UTF-16BE");
+		      break;
+		    case 0x03:
+		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 16],
+							       csize - 6, "UTF-8");
 		      break;
 		    default:
 		      /* bad encoding byte,
@@ -300,7 +324,15 @@ EXTRACTOR_id3v24_extract (const unsigned char *data,
 		      break;
 		    case 0x01:
 		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 14],
-							       csize - 4, "UCS-2");
+							       csize - 4, "UTF-16");
+		      break;
+		    case 0x02:
+		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 14],
+							       csize - 4, "UTF-16BE");
+		      break;
+		    case 0x03:
+		      word = EXTRACTOR_common_convert_to_utf8 ((const char *) &data[pos + 14],
+							       csize - 4, "UTF-8");
 		      break;
 		    default:
 		      /* bad encoding byte,
-- 
1.7.4

Activities

LRN

2012-01-03 00:10

developer   ~0005239

Uploaded a patch. Works for me. But then, the difference shows only in special cases, and my media player writes id3v24 tags in UTF-16, which is mostly similar with UCS-2, which is what is used without this patch, so it makes no difference for me.

Christian Grothoff

2012-01-05 22:07

manager   ~0005246

Fixed in SVN 19024.

Issue History

Date Modified Username Field Change
2011-12-29 18:19 LRN New Issue
2012-01-03 00:09 LRN File Added: 0001-Use-the-right-encodings-as-per-id3v24-specs.patch
2012-01-03 00:10 LRN Note Added: 0005239
2012-01-05 22:07 Christian Grothoff Note Added: 0005246
2012-01-05 22:07 Christian Grothoff Status new => resolved
2012-01-05 22:07 Christian Grothoff Resolution open => fixed
2012-01-05 22:07 Christian Grothoff Fixed in Version => 1.0.0
2012-01-05 22:07 Christian Grothoff Target Version => 1.0.0
2012-01-05 22:07 Christian Grothoff Assigned To => LRN
2012-09-25 17:18 Christian Grothoff Status resolved => closed