BOM (Byte Order Mark): What That Hidden Char Costs
The BOM is a zero-width, invisible character that causes broken CSV imports, JSON parse errors, and HTTP header issues. Learn what it is and how to remove it.
Published:
Tags: encoding, unicode, developer-tools
BOM (Byte Order Mark) Explained: What That Hidden Character Costs You The Byte Order Mark is a zero-width, invisible character that lives at the start of some text files. In the right context, it's a useful encoding signal. In the wrong context, it breaks PHP scripts, corrupts CSV imports, and causes mysterious "unexpected character at position 0" errors. This article explains what the BOM is, when it's necessary, and when it will ruin your day. --- What the BOM Is The BOM is the Unicode character U+FEFF, named "ZERO WIDTH NO-BREAK SPACE" (historically) or "BYTE ORDER MARK" (its primary use in modern Unicode). When it appears at the very start of a text stream, it signals the encoding and byte order of the file. Its byte sequences by encoding: | Encoding | BOM bytes | Hex | |---|---|---|…
All articles · theproductguy.in