text
text copied to clipboard
Add catchable failure decoders for more encodings:
This adds the following decoders:
- decodeUtf16LE'
- decodeUtf16BE'
- decodeUtf32LE'
- decodeUtf32BE'
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?
The code is based on the already provided decodeUtf8' function. I tried to keep it as consistent with the existing code as possible.