Handle streams of text.
Parts of this code were taken from enumerator and adapted for conduits.
Text codecs
encode :: ResourceThrow m => Codec -> Conduit Text m ByteStringSource
Convert text into bytes, using the provided codec. If the codec is not capable of representing an input character, an exception will be thrown.
decode :: ResourceThrow m => Codec -> Conduit ByteString m TextSource
Convert bytes into text, using the provided codec. If the codec is not capable of decoding an input byte sequence, an exception will be thrown.