{-# OPTIONS_HADDOCK hide #-}
-- Copyright 2009 Corey O'Connor
module Codec.Binary.UTF8.Debug where

import Codec.Binary.UTF8.String ( encode )

import Data.Word

import Numeric

-- | Converts an array of ISO-10646 characters (Char type) to an array
-- of Word8 bytes that is the corresponding UTF8 byte sequence
utf8FromIso :: [Int] -> [Word8]
utf8FromIso :: [Int] -> [Word8]
utf8FromIso = String -> [Word8]
encode forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map forall a. Enum a => Int -> a
toEnum

ppUtf8 :: [Int] -> IO ()
ppUtf8 :: [Int] -> IO ()
ppUtf8 = forall a. Show a => a -> IO ()
print forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. (a -> b) -> [a] -> [b]
map (forall a. (Integral a, Show a) => a -> ShowS
`showHex` String
"") forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Int] -> [Word8]
utf8FromIso