text icon indicating copy to clipboard operation
text copied to clipboard

Add catchable failure decoders for more encodings:

Open mrijkeboer opened this issue 7 years ago • 2 comments

This adds the following decoders:

  • decodeUtf16LE'
  • decodeUtf16BE'
  • decodeUtf32LE'
  • decodeUtf32BE'

mrijkeboer avatar Apr 21 '17 11:04 mrijkeboer

These seem like good ideas, but I have two observations.

The names aren't exactly self-documenting :-)

The implementations seem a bit unnatural. Basically if you're round-tripping through unsafePerformIO . try . evaluate, maybe the underlying primitives have the wrong return types?

bos avatar Aug 08 '17 02:08 bos

The code is based on the already provided decodeUtf8' function. I tried to keep it as consistent with the existing code as possible.

mrijkeboer avatar Aug 08 '17 17:08 mrijkeboer