summaryrefslogtreecommitdiff
path: root/junklib.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2012-11-07 18:15:16 +0100
committerGravatar waker <wakeroid@gmail.com>2012-11-07 18:15:16 +0100
commit8df3668914951cdcf3f9c6be75e17a8c3d3c12d8 (patch)
tree351fb4240d486fd3bfdf0653cac7dc7284a2776b /junklib.c
parentd8c66c31fa2a616588f1f4657ad0cfaa26fe982e (diff)
fixed skipping utf8 bom in id3v2 COMM fields
Diffstat (limited to 'junklib.c')
-rw-r--r--junklib.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/junklib.c b/junklib.c
index 5ebfbf1d..8bca1edc 100644
--- a/junklib.c
+++ b/junklib.c
@@ -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;