emilypi / emilypi/Base16

Data.Text.Encoding.Base16.decodeBase16Lenient fails in base16-1.0 with `Invalid UTF-8 stream`

Open
#32 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
5
Forks
11
PR merge metrics
No merged PRs in 30d

Description

Data.Text.Encoding.Base16.decodeBase16Lenient fails in base16-1.0 with `Invalid UTF-8 stream`:

```
"\NUL\DC4ß\DLEGENS" `shouldBe` Data.Text.Encoding.Base16.decodeBase16Lenient "0014df1047454e53"
```
fails with
```
uncaught exception: UnicodeException
Cannot decode byte '\xdf': Data.Text.Encoding: Invalid UTF-8 stream
```
This is a regression as with `base16-0.3.2.1` this didn't fail and produced the string `"\NUL\DC4ß\DLEGENS"`

Also the [haddock](https://hackage.haskell.org/package/base16-1.0/docs/Data-Text-Encoding-Base16.html#v:decodeBase16Lenient) clearly states that `decodeBase16Lenient` never fails: `using a strategy that never fails, catching unicode exceptions raised in the process`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.