diff options
author | waker <wakeroid@gmail.com> | 2012-11-07 18:15:16 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2012-11-07 18:15:16 +0100 |
commit | 8df3668914951cdcf3f9c6be75e17a8c3d3c12d8 (patch) | |
tree | 351fb4240d486fd3bfdf0653cac7dc7284a2776b /junklib.c | |
parent | d8c66c31fa2a616588f1f4657ad0cfaa26fe982e (diff) |
fixed skipping utf8 bom in id3v2 COMM fields
Diffstat (limited to 'junklib.c')
-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; |