|Copyright||(c) The University of Glasgow, 2008-2011|
Types for specifying how text encoding/decoding fails
CodingFailureMode is used to construct
TextEncodings, and specifies how they handle illegal sequences.
Throw an error when an illegal sequence is encountered
Attempt to ignore and recover if an illegal sequence is encountered
Replace with the closest visual match upon an illegal sequence
Use the private-use escape mechanism to attempt to allow illegal sequences to be roundtripped.
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
Word8s 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
Word8s because the
RoundtripFailure mode creates these to round-trip bytes through our internal UTF-16 encoding.
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).