darcs patch: Add UTF8 converting and outputing functions

Ian Lynagh igloo at earth.li
Wed Oct 18 12:03:47 EDT 2006


Hi Jun,

On Sun, Oct 15, 2006 at 01:56:07AM +0900, mukai at jmuk.org wrote:
> 
> hunk ./Data/Char.hs 54
> +#ifdef __GLASGOW_HASKELL__
> +    -- * Converting UTF-8 from/to encoding
> +    , charToUTF8Chars   -- :: Char -> [Char]
> +    , toUTF8String      -- :: String -> String
> +    , fromUTF8String    -- :: String -> String
> +#endif

Why is all this GHC-only?

> hunk ./System/IO.hs 186
> +import GHC.Enum
> +import Data.Char (chr, charToUTF8Chars)
> hunk ./System/IO.hs 344
> +
[...]
> +hPutCharUTF8 :: Handle -> Char -> IO ()
> +hPutCharUTF8 hndl c = hPutStr hndl $ map (chr.fromEnum) $ charToUTF8Chars c
> +
[...]
> +putStrLnUTF8 = hPutStrLnUTF8 stdout
> +

If the earlier stuff really does need to be GHC-only, shouldn't this be
too?


Thanks
Ian



More information about the Libraries mailing list