Hoogle Search
Within LTS Haskell 24.39 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
validateUtf8Chunk :: ByteString -> (Int, Maybe Utf8State)text Data.Text.Encoding Validate a ByteString as UTF-8-encoded text. To be continued using validateUtf8More. See also validateUtf8More for details on the result of this function.
validateUtf8Chunk = validateUtf8More startUtf8State
Properties
Given:validateUtf8Chunk chunk = (n, ms)
- The prefix is valid UTF-8. In particular, it should be accepted by
this validation:
validateUtf8Chunk (take n chunk) = (n, Just startUtf8State)
- The prefix is valid UTF-8. In particular, it should be accepted by
this validation:
validateUtf8More :: Utf8State -> ByteString -> (Int, Maybe Utf8State)text Data.Text.Encoding Validate another ByteString chunk in an ongoing stream of UTF-8-encoded text. Returns a pair:
- The first component n is the end position, relative to the current chunk, of the longest prefix of the accumulated bytestring which is valid UTF-8. n may be negative: that happens when an incomplete code point started in a previous chunk and is not completed by the current chunk (either that code point is still incomplete, or it is broken by an invalid byte).
- The second component ms indicates the
following:
- if ms = Nothing, the remainder of the chunk contains an invalid byte, within four bytes from position n;
- if ms = Just s', you can carry on validating another chunk by calling validateUtf8More with the new state s'.
Properties
Given:validateUtf8More s chunk = (n, ms)
- If the chunk is invalid, it cannot be extended to be valid.
ms = Nothing ==> validateUtf8More s (chunk <> more) = (n, Nothing)
- Validating two chunks sequentially is the same as validating them
together at once:
ms = Just s' ==> validateUtf8More s (chunk <> more) = first (length chunk +) (validateUtf8More s' more)
validateUtf8Chunk :: ByteString -> (Int, Maybe Utf8State)text Data.Text.Internal.Encoding Validate a ByteString as UTF-8-encoded text. To be continued using validateUtf8More. See also validateUtf8More for details on the result of this function.
validateUtf8Chunk = validateUtf8More startUtf8State
Properties
Given:validateUtf8Chunk chunk = (n, ms)
- The prefix is valid UTF-8. In particular, it should be accepted by
this validation:
validateUtf8Chunk (take n chunk) = (n, Just startUtf8State)
- The prefix is valid UTF-8. In particular, it should be accepted by
this validation:
validateUtf8More :: Utf8State -> ByteString -> (Int, Maybe Utf8State)text Data.Text.Internal.Encoding Validate another ByteString chunk in an ongoing stream of UTF-8-encoded text. Returns a pair:
- The first component n is the end position, relative to the current chunk, of the longest prefix of the accumulated bytestring which is valid UTF-8. n may be negative: that happens when an incomplete code point started in a previous chunk and is not completed by the current chunk (either that code point is still incomplete, or it is broken by an invalid byte).
- The second component ms indicates the
following:
- if ms = Nothing, the remainder of the chunk contains an invalid byte, within four bytes from position n;
- if ms = Just s', you can carry on validating another chunk by calling validateUtf8More with the new state s'.
Properties
Given:validateUtf8More s chunk = (n, ms)
- If the chunk is invalid, it cannot be extended to be valid.
ms = Nothing ==> validateUtf8More s (chunk <> more) = (n, Nothing)
- Validating two chunks sequentially is the same as validating them
together at once:
ms = Just s' ==> validateUtf8More s (chunk <> more) = first (length chunk +) (validateUtf8More s' more)
-
text Data.Text.Internal.Encoding.Utf16 No documentation available.
validate2 :: Word16 -> Word16 -> Booltext Data.Text.Internal.Encoding.Utf16 No documentation available.
-
text Data.Text.Internal.Encoding.Utf32 No documentation available.
-
text Data.Text.Internal.Encoding.Utf8 No documentation available.
validate2 :: Word8 -> Word8 -> Booltext Data.Text.Internal.Encoding.Utf8 No documentation available.
validate3 :: Word8 -> Word8 -> Word8 -> Booltext Data.Text.Internal.Encoding.Utf8 No documentation available.