on f42f259 help sign in
vty/src/Codec/Binary/UTF8/Debug.hs
17 lines 435 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
13utf8_from_iso :: Integral i => [i] -> [Word8]
14utf8_from_iso = encode . map toEnum
16pp_utf8 = print . map (\f -> f "") . map showHex . utf8_from_iso