data CodingFailureMode Source
The CodingFailureMode
is used to construct TextEncoding
s, and specifies how they handle illegal sequences.
Constructors
ErrorOnCodingFailureThrow an error when an illegal sequence is encountered
IgnoreCodingFailureAttempt to ignore and recover if an illegal sequence is encountered
TransliterateCodingFailureReplace with the closest visual match upon an illegal sequence
RoundtripFailureUse the private-use escape mechanism to attempt to allow illegal sequences to be roundtripped.
Instances
Show CodingFailureModecodingFailureModeSuffix :: CodingFailureMode -> StringSource
isSurrogate :: Char -> BoolSource
Some characters are actually surrogate codepoints defined for use in UTF-16. We need to signal an invalid character if we detect them when encoding a sequence of Char
s into Word8
s because they won't give valid Unicode.
We may also need to signal an invalid character if we detect them when encoding a sequence of Char
s into Word8
s because the RoundtripFailure
mode creates these to round-trip bytes through our internal UTF-16 encoding.
recoverDecode :: CodingFailureMode -> Buffer Word8 -> Buffer Char -> IO (Buffer Word8, Buffer Char)Source
recoverEncode :: CodingFailureMode -> Buffer Char -> Buffer Word8 -> IO (Buffer Char, Buffer Word8)Source
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4