on cb428e7 help sign in
vty/src/Codec/Binary/UTF8/Debug.hs
18 lines 443 B history raw
1-- Copyright 2009 Corey O'Connor
2module Codec.Binary.UTF8.Debug
3 where
5import Codec.Binary.UTF8.String ( encode )
7import Data.Word
9import Numeric
11-- | Converts an array of ISO-10646 characters (Char type) to an array of Word8 bytes that is the
12-- corresponding UTF8 byte sequence
13utf8FromIso :: [Int] -> [Word8]
14utf8FromIso = encode . map toEnum
16ppUtf8 :: [Int] -> IO ()
17ppUtf8 = print . map (\f -> f "") . map showHex . utf8FromIso