diff options
author | waker <wakeroid@gmail.com> | 2012-11-07 18:15:16 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-11-07 18:15:48 +0100 |
commit | d91782f6b1be4242c743a49a18e3c70ae6455f00 (patch) | |
tree | b90826af57688d6fc2b46706fee3e9d2683cc81f | |
parent | f2d96e18e2e1bc18f77959d9d53bbd6fca241f6c (diff) |
fixed skipping utf8 bom in id3v2 COMM fields
-rw-r--r-- | junklib.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -2904,8 +2904,17 @@ junk_load_comm_frame (int version_major, playItem_t *it, uint8_t *readptr, int s else { strcpy (comment, value); } + trace ("COMM combined: %s\n", comment); - pl_append_meta (it, "comment", comment); + // skip utf8 BOM (can be produced by iconv FEFF/FFFE) + int l = strlen (comment); + uint8_t bom[] = { 0xEF, 0xBB, 0xBF }; + if (l >= 3 && !memcmp (comment, bom, 3)) { + pl_append_meta (it, "comment", comment+3); + } + else { + pl_append_meta (it, "comment", comment); + } free (descr); return 0; |