Hoogle Search
Within LTS Haskell 24.2 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
decodeUtf8 :: ByteString -> Textyesod-auth-oauth2 Yesod.Auth.OAuth2.Prelude Decode a ByteString containing UTF-8 encoded text that is known to be valid. If the input contains any invalid UTF-8 data, an exception will be thrown that cannot be caught in pure code. For more control over the handling of invalid data, use decodeUtf8' or decodeUtf8With. This is a partial function: it checks that input is a well-formed UTF-8 sequence and copies buffer or throws an error otherwise.
decodeUtf8 :: Utf8 textual binary => binary -> textualclassy-prelude-yesod ClassyPrelude.Yesod Note that this function is required to be pure. In the case of a decoding error, Unicode replacement characters must be used.
decodeUtf8 :: MonadUnliftIO m => InputStream ByteString -> m (InputStream Text)unliftio-streams UnliftIO.Streams.Text No documentation available.
-
brick Brick.Widgets.Edit Values that can be constructed by decoding bytestrings in UTF-8 encoding.
decodeUtf8' :: ByteString -> Either UnicodeException Texttext Data.Text.Encoding Decode a ByteString containing UTF-8 encoded text. If the input contains any invalid UTF-8 data, the relevant exception will be returned, otherwise the decoded text.
decodeUtf8Chunk :: ByteString -> (StrictTextBuilder, ByteString, Maybe Utf8State)text Data.Text.Encoding Decode a chunk of UTF-8 text. To be continued with decodeUtf8More. See decodeUtf8More for details on the result.
Properties
decodeUtf8Chunk = decodeUtf8More startUtf8State
Given:decodeUtf8Chunk chunk = (builder, rest, ms)
builder is a prefix and rest is a suffix of chunk.encodeUtf8 (strictBuilderToText builder) <> rest = chunk
decodeUtf8Lenient :: ByteString -> Texttext Data.Text.Encoding Decode a ByteString containing UTF-8 encoded text. Any invalid input bytes will be replaced with the Unicode replacement character U+FFFD.
decodeUtf8More :: Utf8State -> ByteString -> (StrictTextBuilder, ByteString, Maybe Utf8State)text Data.Text.Encoding Decode another chunk in an ongoing UTF-8 stream. Returns a triple:
- A StrictBuilder for the decoded chunk of text. You can accumulate chunks with (<>) or output them with toText.
- The undecoded remainder of the given chunk, for diagnosing errors and resuming (presumably after skipping some bytes).
- Just the new state, or Nothing if an invalid byte was encountered (it will be within the first 4 bytes of the undecoded remainder).
Properties
Given:(pre, suf, ms) = decodeUtf8More s chunk
- If the output pre is nonempty (alternatively, if
length chunk > length suf)
s2b pre `append` suf = p2b s `append` chunk
wheres2b = encodeUtf8 . toText p2b = partUtf8ToByteString
- If the output pre is empty (alternatively, if length
chunk = length suf)
suf = chunk
- Decoding chunks separately is equivalent to decoding their
concatenation.Given:
(pre1, suf1, Just s1) = decodeUtf8More s chunk1 (pre2, suf2, ms2) = decodeUtf8More s1 chunk2 (pre3, suf3, ms3) = decodeUtf8More s (chunk1 `B.append` chunk2)
we have:s2b (pre1 <> pre2) = s2b pre3 ms2 = ms3
decodeUtf8With :: OnDecodeError -> ByteString -> Texttext Data.Text.Encoding Decode a ByteString containing UTF-8 encoded text. Surrogate code points in replacement character returned by OnDecodeError will be automatically remapped to the replacement char U+FFFD.
decodeUtf8Chunk :: ByteString -> (StrictTextBuilder, ByteString, Maybe Utf8State)text Data.Text.Internal.Encoding Decode a chunk of UTF-8 text. To be continued with decodeUtf8More. See decodeUtf8More for details on the result.
Properties
decodeUtf8Chunk = decodeUtf8More startUtf8State
Given:decodeUtf8Chunk chunk = (builder, rest, ms)
builder is a prefix and rest is a suffix of chunk.encodeUtf8 (strictBuilderToText builder) <> rest = chunk