libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 734f5b9fc037f614df9db3fb46b667c1a8b254fa
parent 0d87065a62b4f144559245c5a0bda26e899e1f35
Author: Christian Grothoff <christian@grothoff.org>
Date:   Thu,  5 Jan 2012 21:06:06 +0000

LRN: fixing #2047, non-standard compliant id3v24 extractor with respect to character sets

Diffstat:
Msrc/plugins/id3v24_extractor.c | 40++++++++++++++++++++++++++++++++++++----
1 file changed, 36 insertions(+), 4 deletions(-)

diff --git 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,