lathe-0.1.0.0: Pure incremental byte parser.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Parser.Lathe.Encoding.UTF32

Description

Functions for parsing UTF-32, both little-endian and big-endian.

Synopsis

Byte-order mark

utf32BOM Source #

Arguments

:: e

Malformed.

-> e

Reached end.

-> Parser e ByteOrder 

Consume 4 bytes that represent a UTF-32 byte-order mark and return the corresponding ByteOrder.

UTF-32

newtype UTF32Point Source #

Unicode code unit.

Constructors

UTF32Point Word32 

fromUtf32 :: UTF32Point -> Char Source #

Convert a code point into a Char.

isSurrogate :: UTF32Point -> Bool Source #

Check whether a code point lies in the surrogate range (U+D800 to U+DFFF).

Parsers

unitUtf32BE Source #

Arguments

:: e

Code unit is greater than U+10FFFF.

-> e

Reached end.

-> Parser e UTF32Point 

Consume 4 bytes that represents a big-endian UTF-32 character.

unitUtf32LE Source #

Arguments

:: e

Code unit is greater than U+10FFFF.

-> e

Reached end.

-> Parser e UTF32Point 

Consume 4 bytes that represents a little-endian UTF-32 character.