on 41c42df help sign in
vty/src/Codec/Binary/UTF8/Debug.hs
19 lines 494 B history raw
1{-# LANGUAGE NoMonomorphismRestriction #-}
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
14utf8_from_iso :: [Int] -> [Word8]
15utf8_from_iso = encode . map toEnum
17pp_utf8 :: [Int] -> IO ()
18pp_utf8 = print . map (\f -> f "") . map showHex . utf8_from_iso