ghc-internal-9.1002.0: Basic libraries
Copyright2012 shelarcy
LicenseBSD-style
Maintainershelarcy@gmail.com
StabilityProvisional
PortabilityNon-portable (Win32 API)
Safe HaskellNone
LanguageHaskell2010

GHC.Internal.IO.Windows.Encoding

Description

Encode/Decode multibyte character using Win32 API.

Synopsis

Documentation

encodeMultiByte :: CodePage -> String -> String Source #

The System.IO output functions (e.g. putStr) don't automatically convert to multibyte string on Windows, so this function is provided to make the conversion from a Unicode string in the given code page to a proper multibyte string. To get the code page for the console, use getCurrentCodePage.

decodeMultiByteIO :: CodePage -> String -> IO String Source #

Because of stringToUnicode is unclear name, we use decodeMultiByteIO for alias of stringToUnicode.

withUTF16ToGhcInternal :: Ptr Word8 -> Int -> (CInt -> Ptr Word16 -> IO CInt) -> IO Int Source #

Decode a UTF16 buffer into the given buffer in the current code page. The source UTF16 buffer is filled by the function given as argument.