This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#5770 - skip BOM in playlists
Attached to Project:
Rockbox
Opened by Dominik Riebeling (bluebrother) - Friday, 04 August 2006, 22:03 GMT+2
Opened by Dominik Riebeling (bluebrother) - Friday, 04 August 2006, 22:03 GMT+2
|
DetailsWhen loading a playlist which has a BOM the first entry gets invalid and thus will be skipped. The attached patch looks if the playlist has a utf8 BOM and skips that. Also added m3u8 as recognized playlist format which is simply a m3u playlist with utf8 encoding and BOM. This format is generated by foobar2000. See also
Patch tested on h120 sim. |
This task depends upon
Closed by Magnus Holmgren (learman)
Sunday, 10 September 2006, 13:09 GMT+2
Reason for closing: Accepted
Additional comments about closing: Patch committed. Thanks!
Sunday, 10 September 2006, 13:09 GMT+2
Reason for closing: Accepted
Additional comments about closing: Patch committed. Thanks!
but in gwps-common.c is already a (local) function
called skip_utf8_bom which does more checks than
your version:
------------------------------------------------------
if(s[0] == 0xef && s[1] == 0xbb && s[2] == 0xbf)
{
buf += 3;
}
------------------------------------------------------
maybe you could create a patch which puts the skip_utf8_bom
to a global context and then use it for your purpose?
The check looks for a utf8 BOM which is the three bytes from the skip_utf8_bom function. On the other hand 0xef is in the extended character set so when assuming a non-utf playlist this wouldn't work at all. Thus I think it is sufficient to simply check for the first start of the BOM. I've entended the patch to look also for the other two BOM bytes but I think this isn't necessary at all.