Copy tests from GHC testsuite; part of #1161.
[packages/base.git] / tests / IO / hSetEncoding002.hs
1 -- test for #4066
2
3 import System.IO
4
5 import GHC.IO.FD as FD (stdout)
6 import GHC.IO.Handle.FD as FD (fdToHandle)
7 import GHC.IO.Handle ( mkDuplexHandle )
8
9 main = do
10 h <- mkDuplexHandle FD.stdout "stdout" Nothing noNewlineTranslation
11 hSetEncoding h utf8
12 hPutStrLn h "รถ"
13 hClose h