Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module treats Bytes
data as holding text encoded in ISO-8859-1. This
encoding can only encode codepoints strictly below U+0100
, but this allows
each codepoint to be placed directly into a single byte. This range consists
of Unicode Basic Latin, Latin-1 Supplement and C0+C1 Controls, which includes
ASCII.
Strictly, ISO-8859-1 is not to be confused with ISO/IEC 8859-1 (which was the default encoding for webpages before HTML5). ISO/IEC 8859-1 lacks encodings for the C0 and C1 control characters.
With HTML5, the default encoding of webpages was changed to Windows-1252,
which is _not_ compatible with ISO-8859-1. Windows-1252 uses the C1 Control
range (U+0080
-- U+009F
) mostly to encode a variety of printable
characters. For this encoding, see Windows1252
.
Synopsis
- toString :: Bytes -> String
- fromString :: String -> Bytes
- equals1 :: Char -> Bytes -> Bool
- equals2 :: Char -> Char -> Bytes -> Bool
- equals3 :: Char -> Char -> Char -> Bytes -> Bool
- equals4 :: Char -> Char -> Char -> Char -> Bytes -> Bool
- equals5 :: Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals6 :: Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals7 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals8 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals9 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals10 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals11 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
- equals12 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool
Documentation
fromString :: String -> Bytes Source #
Convert a String
consisting of only characters representable
by ISO-8859-1. These are encoded with ISO-8859-1. Any character
with a codepoint above U+00FF
is replaced by an unspecified byte.
Specialized Comparisons
equals1 :: Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a singleton whose element matches the character?
equals2 :: Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a doubleton whose elements match the characters?
equals3 :: Char -> Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a tripleton whose elements match the characters?
equals4 :: Char -> Char -> Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a quadrupleton whose elements match the characters?
equals5 :: Char -> Char -> Char -> Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a quintupleton whose elements match the characters?
equals6 :: Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a sextupleton whose elements match the characters?
equals7 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a septupleton whose elements match the characters?
equals8 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, an octupleton whose elements match the characters?
equals9 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a 9-tuple whose elements match the characters?
equals10 :: Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Char -> Bytes -> Bool Source #
Is the byte sequence, when interpreted as ISO-8859-1-encoded text, a 10-tuple whose elements match the characters?