On unix machines, returns the system's currently configured text encoding, or Nothing if there was an error. On Windows, currently always returns Nothing.
Moduleencoding-0.10.3Haskell2010
System.IO.Encoding
This module provides a replacement for the normal (unicode unaware) IO functions of haskell. By using implicit parameters, it can be used almost as a drop-in replacement. For example, consider the following simple echo program:
main = do
str <- getContents
putStr strTo make this program process UTF-8 data, change the program to:
{-# LANGUAGE ImplicitParams #-}
import Prelude hiding (getContents,putStr)
import System.IO.Encoding
import Data.Encoding.UTF8
main = do
let ?enc = UTF8
str <- getContents
putStr strOr, if you want to use the standard system encoding:
{-# LANGUAGE ImplicitParams #-}
import Prelude hiding (getContents,putStr)
import System.IO.Encoding
main = do
e <- getSystemEncoding
let ?enc = e
str <- getContents
putStr str- 19 values
- Packageencoding-0.10.3
- Exports19
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceEncoding.hs
Like the normal System.IO.hPutStr, but encodes the output using an
encoding.
Like the normal System.IO.hGetContents, but decodes the input using an
encoding.