HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

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.