"\uFEFF" is for UTF-16 (BE). So I think we should also check BOM for other unicode, at least "\uEFBBBF" for UTF-8 and "\uFFFE" for UTF-16 (LE).