serialise-0.2.4.0: A binary serialisation library for Haskell values.
Safe HaskellNone
LanguageHaskell2010

Codec.Serialise.Internal.GeneralisedUTF8

Contents

Synopsis

Documentation

encodeGenUTF8 :: String -> (SlicedByteArray, UTF8Encoding) Source #

Encode a string as (generalized) UTF-8. In addition to the encoding, we return a flag indicating whether the encoded string contained any surrogate characters, in which case the output is generalized UTF-8.

Utilities

isSurrogate :: Char -> Bool Source #

Is a Char a UTF-16 surrogate?

isValid :: UTF8Encoding -> [Word8] -> Bool Source #

Is the given byte sequence valid under the given encoding?