Skip to content

v1.2.0

Latest

Choose a tag to compare

@dimchansky dimchansky released this 21 Oct 17:53
ad37ce7

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

  • Skip on an existing *utfbom.Reader now returns the encoding detected originally instead of Unknown (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) made io.ReadAll fail. 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.
  • Encoding constant values and Encoding.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/ioutil is no longer used.

Full changelog: v1.1.1...v1.2.0