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