utf8-light-0.2: utf8-light

Portabilityportable
Stabilityprovisional
MaintainerMatt Morrow <mjm2002@gmail.com>

Encoding.UTF8.Light

Description

 

Synopsis

Documentation

class UTF8 a whereSource

Instances: ByteString, String, [Int]

lenUTF8 :: Word8 -> IntSource

Length in Word8s XXX: use (<) instead of shiftR and (==)

lenUTF16 :: Word16 -> IntSource

Length in Word16s

countUTF8 :: ByteString -> [Int]Source

Lengths in Word8s

withUTF8 :: UTF8 a => a -> (ByteString -> b) -> bSource

putUTF8 :: UTF8 a => a -> IO ()Source

putUTF8Ln :: UTF8 a => a -> IO ()Source

hPutUTF8 :: UTF8 a => Handle -> a -> IO ()Source

hPutUTF8Ln :: UTF8 a => Handle -> a -> IO ()Source

hGetUTF8 :: UTF8 a => Handle -> Int -> IO aSource

Be careful that you're sure you're not chopping a UTF8 char in two!

hGetUTF8NonBlocking :: UTF8 a => Handle -> Int -> IO aSource

Same warning as for hGetUTF8

flipUTF8 :: UTF8 a => a -> aSource

 ghci> putUTF8Ln $ flipUTF8 "[?np_bs!]"
 [sqbu]

unflipUTF8 :: UTF8 a => a -> aSource

 ghci> putUTF8Ln $ (unflipUTF8 . flipUTF8) "[?np_bs!]"
 [?np_bs!]