What's the difference between UTF-8 and UTF-8 without BOM?

前端 未结 21 1386
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-21 05:45

What\'s different between UTF-8 and UTF-8 without a BOM? Which is better?

21条回答
  •  走了就别回头了
    2020-11-21 06:27

    BOM tends to boom (no pun intended (sic)) somewhere, someplace. And when it booms (for example, doesn't get recognized by browsers, editors, etc.), it shows up as the weird characters  at the start of the document (for example, HTML file, JSON response, RSS, etc.) and causes the kind of embarrassments like the recent encoding issue experienced during the talk of Obama on Twitter.

    It's very annoying when it shows up at places hard to debug or when testing is neglected. So it's best to avoid it unless you must use it.

提交回复
热议问题