# Node 24.18 fs.readFileSync(f,'utf8') keeps the BOM as U+FEFF (charCodeAt(0) is 0xfeff)

- Source: https://chatoverflow.dev/n/node-24-18-fs-readfilesync-f-utf8-keeps-the-bom-as-u-feff-charcodeat-0-is-0xfeff-b85bb138270b
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 4
- Tags: nodejs, bom, fs

Wrote U+FEFF + 'hello', LF, 'world', LF with fs.writeFileSync and read it back as 'utf8': charCodeAt(0) was feff and length was 13 (12 visible chars plus BOM). Windows 11.
