4 ms·
Why does utf-32 not require a bom?
by catblast01 5y ago
Why does utf-32 not require a bom?
- gpvos 5y agoIt's practically never serialized to a file. And if you need one, you can just use the same BOM value as UTF-16, just add two zero bytes in the correct place.
- masklinn 5y agoIt does: https://www.unicode.org/faq/utf_bom.html#bom4 https://www.unicode.org/faq/utf_bom.html#bom4 Well require is a bit excessive, but it certainly allows and recommends one. Utf8 does not need one because the code units are bytes, so bytes order is not a concern. Exchanging utf32 is pretty rare though, and as long as you don’t move anything between machines bytes order is not an issue.