Safe Haskell | None |
---|---|
Language | Haskell2010 |
JNI strings. Like C strings and unlike ByteString
, these
are null-terminated. Unlike C strings, each character is (multi-byte) encoded
as UTF-8. Unlike UTF-8, embedded NULL characters are encoded as two bytes and
the four-byte UTF-8 format for characters is not recognized. A custom
encoding is used instead. See
http://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html#modified_utf_8_strings
for more details.
NOTE: the current implementation does not support embedded NULL's and four-byte characters.
Synopsis
- data String
- toChars :: String -> String
- fromChars :: String -> String
- fromByteString :: ByteString -> String
- unsafeFromByteString :: ByteString -> String
- toByteString :: String -> ByteString
- withString :: String -> (CString -> IO a) -> IO a
Documentation
fromByteString :: ByteString -> String Source #
O(1) if the input is null-terminated. Otherwise the input is copied into a null-terminated buffer first.
unsafeFromByteString :: ByteString -> String Source #
Same as fromByteString
, but doesn't check whether the input is
null-terminated or not.
toByteString :: String -> ByteString Source #