Commit 39001864 authored by batterseapower's avatar batterseapower
Browse files

Add test for #7522

parent 69a8c2d2
...@@ -144,6 +144,7 @@ test('encoding001', ...@@ -144,6 +144,7 @@ test('encoding001',
compile_and_run, ['']) compile_and_run, [''])
test('encoding002', normal, compile_and_run, ['']) test('encoding002', normal, compile_and_run, [''])
test('encoding003', normal, compile_and_run, [''])
test('environment001', test('environment001',
[when(msys(), expect_fail), # Doesn't work on MSYS; see #5599 [when(msys(), expect_fail), # Doesn't work on MSYS; see #5599
......
import System.IO
import System.Directory
import Data.Char
tempFile = "temp"
create :: IO ()
create = do
h <- openFile tempFile WriteMode
hSetEncoding h latin1
hPutStr h [chr 128]
hClose h
main :: IO ()
main = do
create
utf8Ignore <- mkTextEncoding "UTF8//IGNORE"
h <- openFile tempFile ReadMode
hSetEncoding h utf8Ignore
hGetContents h >>= putStrLn
removeFile tempFile
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment