on cceeeee help sign in
vty/src/Codec/Binary/UTF8/Debug.hs
19 lines 472 B history raw
1{-# OPTIONS_HADDOCK hide #-}
2-- Copyright 2009 Corey O'Connor
3module Codec.Binary.UTF8.Debug
4 where
6import Codec.Binary.UTF8.String ( encode )
8import Data.Word
10import Numeric
12-- | Converts an array of ISO-10646 characters (Char type) to an array of Word8 bytes that is the
13-- corresponding UTF8 byte sequence
14utf8FromIso :: [Int] -> [Word8]
15utf8FromIso = encode . map toEnum
17ppUtf8 :: [Int] -> IO ()
18ppUtf8 = print . map (\f -> f "") . map showHex . utf8FromIso