This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#6203 - unified way to open utf8 text files
Attached to Project:
Rockbox
Opened by Dominik Riebeling (bluebrother) - Tuesday, 17 October 2006, 22:57 GMT+2
Last edited by Dominik Riebeling (bluebrother) - Saturday, 02 August 2008, 22:39 GMT+2
Opened by Dominik Riebeling (bluebrother) - Tuesday, 17 October 2006, 22:57 GMT+2
Last edited by Dominik Riebeling (bluebrother) - Saturday, 02 August 2008, 22:39 GMT+2
|
DetailsSince Rockbox supports utf8 there has been the issue of text files containing a BOM created by some editors. Rockbox needs to skip that BOM which is currently done independently in various places (and still missing in a couple of places). This patch addresses this by introducing a new open_utf8() function which behaves exactly like open() but places the file pointer to the first text byte after opening. That way opening a text file only needs to use that function and doesn't need to bother with a BOM anymore.
The attached patch changes this in a couple of places (see also commited |
This task depends upon
Closed by Dominik Riebeling (bluebrother)
Saturday, 02 August 2008, 22:39 GMT+2
Reason for closing: Accepted
Additional comments about closing: committed adapted version as r18185.
Saturday, 02 August 2008, 22:39 GMT+2
Reason for closing: Accepted
Additional comments about closing: committed adapted version as r18185.
If there are no objections I'd be fine picking it up again and committing it after the missing testing has been done.
Maybe the utf8_open function could also _write_ a BOM in case it's called with specific flags set (e.g. O_CREAT or O_WRONLY)?