|
Codec.Binary.UTF8.Generic |
|
|
Description |
This module provides fast, validated encoding and decoding functions
between ByteStrings and Strings. It does not exactly match the
output of the Codec.Binary.UTF8.String output for invalid encodings
as the number of replacement characters is sometimes longer.
|
|
Synopsis |
|
|
|
Documentation |
|
|
| Methods | bsplit :: s -> b -> (b, b) | Source |
| | | | | | | | | | | | | | |
| | Instances | |
|
|
|
Try to extract a character from a byte string.
Returns Nothing if there are no more bytes in the byte string.
Otherwise, it returns a decoded character and the number of
bytes used in its representation.
Errors are replaced by character '\0xFFFD'.
|
|
|
This character is used to mark errors in a UTF8 encoded string.
|
|
|
Get the first character of a byte string, if any.
Malformed characters are replaced by '\0xFFFD'.
|
|
|
Split after a given number of characters.
Negative values are treated as if they are 0.
|
|
|
take n s returns the first n characters of s.
If s has less then n characters, then we return the whole of s.
|
|
|
drop n s returns the s without its first n characters.
If s has less then n characters, then we return the an empty string.
|
|
|
Split a string into two parts: the first is the longest prefix
that contains only characters that satisfy the predicate; the second
part is the rest of the string.
Invalid characters are passed as '\0xFFFD' to the predicate.
|
|
|
Split a string into two parts: the first is the longest prefix
that contains only characters that do not satisfy the predicate; the second
part is the rest of the string.
Invalid characters are passed as '\0xFFFD' to the predicate.
|
|
|
Converts a Haskell string into a UTF8 encoded bytestring.
|
|
|
Convert a UTF8 encoded bytestring into a Haskell string.
Invalid characters are replaced with '\xFFFD'.
|
|
|
Traverse a bytestring (left biased).
This fuction is strict in the acumulator.
|
|
|
Traverse a bytestring (right biased).
|
|
|
Counts the number of characters encoded in the bytestring.
Note that this includes replacment characters.
|
|
|
Split a string into a list of lines.
Lines are termianted by '\n' or the end of the string.
Empty line may not be terminated by the end of the string.
See also 'lines\''.
|
|
|
Split a string into a list of lines.
Lines are termianted by '\n' or the end of the string.
Empty line may not be terminated by the end of the string.
This function preserves the terminators.
See also lines.
|
|
Produced by Haddock version 2.6.0 |