HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulebase-4.23.0.0Haskell2010

GHC.IO.Encoding.Failure

Types for specifying how text encoding/decoding fails

  • 1 type
  • 6 values
  • Packagebase-4.23.0.0
  • Exports7
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceFailure.hs
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.