joyent/node — Issue #1918: fs.readFileSync(filename, 'utf8') doesn't strip BOM markers
Author: dobesv
Created: 2011-10-21 11:43:25+00:00
State: open

Environment: cloud9ide.com, node version 0.4.5

If I read a file using fs.readFileSync(filename, 'utf8') that is encoded using UTF8 with BOM, the BOM is included in the resulting string.

I think the routine to decode UTF8 is supposed to automatically strip the BOM from the start of the stream before returning the string.