Movatterモバイル変換


[0]ホーム

URL:


base-4.12.0.0: Basic libraries

Copyright(c) The University of Glasgow 2008-2011
Licensesee libraries/base/LICENSE
Maintainerlibraries@haskell.org
Stabilityinternal
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell2010

GHC.IO.Encoding.Failure

Description

Types for specifying how text encoding/decoding fails

Synopsis

Documentation

dataCodingFailureModeSource#

TheCodingFailureMode is used to constructTextEncodings, and specifies how they handle illegal sequences.

Constructors

ErrorOnCodingFailure

Throw an error when an illegal sequence is encountered

IgnoreCodingFailure

Attempt to ignore and recover if an illegal sequence is encountered

TransliterateCodingFailure

Replace with the closest visual match upon an illegal sequence

RoundtripFailure

Use the private-use escape mechanism to attempt to allow illegal sequences to be roundtripped.

Instances
ShowCodingFailureModeSource#

Since: 4.4.0.0

Instance details

Defined inGHC.IO.Encoding.Failure

codingFailureModeSuffix ::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 ofChars intoWord8s because they won't give valid Unicode.

We may also need to signal an invalid character if we detect them when encoding a sequence ofChars intoWord8s because theRoundtripFailure mode creates these to round-trip bytes through our internal UTF-16 encoding.

recoverDecode ::CodingFailureMode ->BufferWord8 ->BufferChar ->IO (BufferWord8,BufferChar)Source#

recoverEncode ::CodingFailureMode ->BufferChar ->BufferWord8 ->IO (BufferChar,BufferWord8)Source#

Produced byHaddock version 2.20.0


[8]ページ先頭

©2009-2025 Movatter.jp