hslua-core-2.3.2: Bindings to Lua, an embeddable scripting language

Copyright | © 2018-2024 Albert Krewinkel
License | MIT
Maintainer | Albert Krewinkel <tarleb@hslua.org>
Stability | beta
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

HsLua.Core.Utf8

Description

Encoding and decoding of String to and from UTF8.

Synopsis

- toString :: ByteString -> String
- toText :: ByteString -> Text
- fromString :: String -> ByteString
- fromText :: Text -> ByteString

# Documentation

toString :: ByteString -> String Source #

Decode ``ByteString`` to ``String`` using UTF-8. Invalid input bytes are replaced with the Unicode replacement character U+FFFD.

toText :: ByteString -> Text Source #

Decode ``ByteString`` to ``Text`` using UTF-8. Invalid input bytes are replaced with the Unicode replacement character U+FFFD.

fromString :: String -> ByteString Source #

Encode ``String`` to ``ByteString`` using UTF-8.

fromText :: Text -> ByteString Source #

Encode ``Text`` to ``ByteString`` using UTF-8.