UTF にはまず Encoding Form としての UTF と Encoding Scheme としての UTF があり、BOMは Encoding Scheme で使われる仕様。 UTF-16 については BOM の扱いが厳格に決まっているのに対して UTF-8 については BOM の扱いに関する規定はやや曖昧に書かれている。しかし、

- バイト順を規定する意味はない
- UTF-8 であることを特定するためのシグネチャとしての利用は可能であり、受け取り側は UTF-8 BOM を除去することが推奨される

ことは規格書の後ろの方の規定(§23)でこっそり触れられている。

0

If you have a fediverse account, you can quote this note from your own instance. Search https://qnmd.info/users/qnighy/statuses/116078390534981217 on your instance and quote it. (Note that quoting is not supported in Mastodon.)