Repository navigation
Requirements
This release requires Go 1.19 or later (go.mod now declares go 1.19). It is tested on Go 1.19 and the two current Go releases.
Fixes
Skipon an existing*utfbom.Readernow returns the encoding detected originally instead ofUnknown(PR #9, fixes #12).- An error returned by the source after many empty reads is no longer replaced with
io.ErrNoProgress. Previously, 99 consecutive(0, nil)reads followed by(0, io.EOF)madeio.ReadAllfail. When this happened after reading a 2–3 byte UTF-16 prefix, its BOM was also left unrecognized. - A UTF-16 BOM is detected when the source returns the first 4 bytes together with a non-EOF error. Previously detection depended on whether the error came with the data or on the next
Read.
Unchanged on purpose: if probing stops with a non-EOF error before 4 bytes are read, a UTF-16 BOM (FE FF / FF FE) is still not recognized and the bytes are passed through, as in earlier releases.
Compatibility
- Exported API signatures are unchanged.
Encodingconstant values andEncoding.String()results are unchanged.
Documentation and maintenance
- README rewritten: package boundaries, BOM table and a Behavior section. Go doc comments expanded, including runnable examples.
- More tests, a fuzz target and benchmarks for small streams with and without a BOM and a larger stream.
- CI moved from Travis CI to GitHub Actions;
io/ioutilis no longer used.
Full changelog: v1.1.1...v1.2.0