Re:Finding CSV files that start with a BOM using ripgrep
by catblast01 on Saturday May 29, 2021 @08:41AM
(#27324867)
Why does utf-32 not require a bom?
[ Parent
| on HN ]
Re:Finding CSV files that start with a BOM using ripgrep
by gpvos on Saturday May 29, 2021 @08:55AM
(#27324942)
It'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.
Re:Finding CSV files that start with a BOM using ripgrep
by masklinn on Saturday May 29, 2021 @10:30AM
(#27325481)
It does: 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.