HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-internal-9.1003.0Haskell2010

GHC.Internal.IO.Encoding.Failure

Types for specifying how text encoding/decoding fails

  • 1 type
  • 6 values
datadata CodingFailureMode
#

The CodingFailureMode is used to construct System.IO.TextEncodings, and specifies how they handle illegal sequences.

Constructors

Instances1Show
valueisSurrogate :: Char -> Bool
#

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 Chars into 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 Chars into Word8s because the RoundtripFailure mode creates these to round-trip bytes through our internal UTF-16 encoding.