Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d714cc4
commit 1ac38ef
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
|