utf8: add function to detect prohibited UTF-16/32 BOM
authorLars Schneider <larsxschneider@gmail.com>
Sun, 15 Apr 2018 18:16:05 +0000 (20:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Apr 2018 02:40:56 +0000 (11:40 +0900)
commit10ecb82e4f1f507d5f122e00fd4829b30953f853
tree58e2245d175a29290fc4405988ab650b5b669207
parent2f0c4a362c5db677ee392a6a550632bfb22d8319
utf8: add function to detect prohibited UTF-16/32 BOM

Whenever a data stream is declared to be UTF-16BE, UTF-16LE, UTF-32BE
or UTF-32LE a BOM must not be used [1]. The function returns true if
this is the case.

This function is used in a subsequent commit.

[1] http://unicode.org/faq/utf_bom.html#bom10

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
utf8.c
utf8.h