Personal tools

UTF-8

From HaskellWiki

Revision as of 09:24, 21 July 2008 by EricKow (Talk | contribs)

Jump to: navigation, search


The simplest solution seems to be to use the utf8-string package from Galois. It provides a drop-in replacement for System.IO

import System.IO.UTF8
import Prelude hiding (getContents, putStrLn)
 
main =
 do putStrLn "what is your name? "
    name <- getContents
    putStrLn $ "hello, " ++ name ++ "!"