Commit graph

1 commit

Author SHA1 Message Date
Jonathan M Davis
5d52a81e4d Fix issue 15949: Make readText check BOMs.
This makes it so that readText checks for a BOM. If there is a BOM, it
is for UTF-8, UTF-16, or UTF-32, and it doesn't match the requested
string type, then a UTFException is thrown. Other encodings are let
through in case they happen to work with the requested string type and
pass UTF validation.

Also, this makes it so that readText checks the alignment of the buffer
against the requested string type and throws a UTFException instead of
letting the cast throw an Error.
2018-02-10 19:53:29 -07:00