Personal tools

UTF-8

From HaskellWiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 09:24, 21 July 2008


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 ++ "!"