summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorNick Peskett <rockbox@peskett.co.uk>2011-12-18 01:43:55 +0000
committerNick Peskett <rockbox@peskett.co.uk>2011-12-18 01:43:55 +0000
commit6aa070268fd95a880eeb475a63bac5e0060ea76f (patch)
tree7d2d585b56a319bfdb5c501204a96d450b07e607 /apps
parentae90b29dcb56cf74d4d561fed33a6c843d469b55 (diff)
downloadrockbox-6aa070268fd95a880eeb475a63bac5e0060ea76f.zip
rockbox-6aa070268fd95a880eeb475a63bac5e0060ea76f.tar.gz
rockbox-6aa070268fd95a880eeb475a63bac5e0060ea76f.tar.bz2
rockbox-6aa070268fd95a880eeb475a63bac5e0060ea76f.tar.xz
Type 1 text encoding uses BOM to decide byte order, type 2 has no BOM and is BE.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31349 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/metadata/id3tags.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/metadata/id3tags.c b/apps/metadata/id3tags.c
index 855394e..7e767c7 100644
--- a/apps/metadata/id3tags.c
+++ b/apps/metadata/id3tags.c
@@ -1007,14 +1007,17 @@ void setid3v2title(int fd, struct mp3entry *entry)
char_enc = CHAR_ENC_ISO_8859_1;
break;
case 0x01:
- char_enc = CHAR_ENC_UTF_16_LE;
- /* \1 + \xff\xfe + C\0U\0E\0S\0H\0E\0E\0T\0\0\0 = 21 */
+ if (memcmp(tag, "\1\xfe\xff", 3))
+ char_enc = CHAR_ENC_UTF_16_BE;
+ else if (memcmp(tag, "\1\xff\xfe", 3))
+ char_enc = CHAR_ENC_UTF_16_LE;
+ /* \1 + BOM(2) + C0U0E0S0H0E0E0T000 = 21 */
cuesheet_offset = 21;
break;
case 0x02:
char_enc = CHAR_ENC_UTF_16_BE;
- /* \2 + \xfe\xff + \0C\0U\0E\0S\0H\0E\0E\0T\0\0 = 21 */
- cuesheet_offset = 21;
+ /* \2 + 0C0U0E0S0H0E0E0T00 = 19 */
+ cuesheet_offset = 19;
break;
case 0x03:
char_enc = CHAR_ENC_UTF_8;