emilypi / Base16

BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

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

Open jonathangenlambda opened 3 months ago

jonathangenlambda commented 3 months ago

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 clearly states that decodeBase16Lenient never fails: using a strategy that never fails, catching unicode exceptions raised in the process.

emilypi commented 3 months ago

Thanks for the report @jonathangenlambda.

emilypi commented 3 months ago

I have some homework to do now. None of that code significantly changed in this library between 1.0 and 0.3.2.1, so my suspicion is that the minimum dependency bumps are to blame here. I'm working on bisecting.