Portability | portable |
---|---|
Stability | provisional |
Maintainer | Matt Morrow <mjm2002@gmail.com> |
- class UTF8 a where
- encode :: a -> ByteString
- decode :: ByteString -> a
- lenUTF8 :: Word8 -> Int
- lenUTF16 :: Word16 -> Int
- countUTF8 :: ByteString -> [Int]
- decodeUTF8 :: ByteString -> [Int]
- encodeUTF8 :: [Int] -> ByteString
- encodeUTF8' :: [Int] -> [[Word8]]
- withUTF8 :: UTF8 a => a -> (ByteString -> b) -> b
- putUTF8 :: UTF8 a => a -> IO ()
- putUTF8Ln :: UTF8 a => a -> IO ()
- hPutUTF8 :: UTF8 a => Handle -> a -> IO ()
- hPutUTF8Ln :: UTF8 a => Handle -> a -> IO ()
- readUTF8File :: UTF8 a => FilePath -> IO a
- writeUTF8File :: UTF8 a => FilePath -> a -> IO ()
- appendUTF8File :: UTF8 a => FilePath -> a -> IO ()
- hGetUTF8Line :: UTF8 a => Handle -> IO a
- hGetUTF8Contents :: UTF8 a => Handle -> IO a
- hGetUTF8 :: UTF8 a => Handle -> Int -> IO a
- hGetUTF8NonBlocking :: UTF8 a => Handle -> Int -> IO a
- flipUTF8 :: UTF8 a => a -> a
- unflipUTF8 :: UTF8 a => a -> a
- flipTab :: [(Int, Int)]
- unflipTab :: [(Int, Int)]
- showHex :: Int -> String
- toBits :: Word8 -> [Word8]
- fromBits :: [Word8] -> Word8
Documentation
Instances: ByteString
, String
, [Int]
encode :: a -> ByteStringSource
decode :: ByteString -> aSource
countUTF8 :: ByteString -> [Int]Source
Lengths in Word8s
decodeUTF8 :: ByteString -> [Int]Source
encodeUTF8 :: [Int] -> ByteStringSource
encodeUTF8' :: [Int] -> [[Word8]]Source
withUTF8 :: UTF8 a => a -> (ByteString -> b) -> bSource
readUTF8File :: UTF8 a => FilePath -> IO aSource
hGetUTF8Line :: UTF8 a => Handle -> IO aSource
hGetUTF8Contents :: UTF8 a => Handle -> IO aSource
hGetUTF8 :: UTF8 a => Handle -> Int -> IO aSource
Be careful that you're sure you're not chopping a UTF8 char in two!
unflipUTF8 :: UTF8 a => a -> aSource
ghci> putUTF8Ln $ (unflipUTF8 . flipUTF8) "[?np_bs!]" [?np_bs!]