System.IO.CodePage

code-page-0.1.1: Windows code page library for Haskell

Copyright | (C) 2016 Ryan Scott
License | BSD-style (see the file LICENSE)
Maintainer | Ryan Scott
Stability | Provisional
Portability | Portable
Safe Haskell | Safe
Language | Haskell2010

System.IO.CodePage

Description

Exports functions which adjust code pages on Windows, and do nothing on other operating systems.

Synopsis

- withCP65001 :: IO a -> IO a
- withCP1200 :: IO a -> IO a
- withCP1201 :: IO a -> IO a
- withCP12000 :: IO a -> IO a
- withCP12001 :: IO a -> IO a
- withCodePage :: CodePage -> IO a -> IO a
- withCodePageVerbosity :: Bool -> CodePage -> IO a -> IO a
- type CodePage = Word32
- cp65001 :: CodePage
- cp1200 :: CodePage
- cp1201 :: CodePage
- cp12000 :: CodePage
- cp12001 :: CodePage

# Documentation

withCP65001 :: IO a -> IO a #

Sets the code page for an action to UTF-8 as necessary.

withCP1200 :: IO a -> IO a #

Sets the code page for an action to UTF-16LE as necessary.

withCP1201 :: IO a -> IO a #

Sets the code page for an action to UTF-16BE as necessary.

withCP12000 :: IO a -> IO a #

Sets the code page for an action to UTF-32LE as necessary.

withCP12001 :: IO a -> IO a #

Sets the code page for an action to UTF-32BE as necessary.

withCodePage :: CodePage -> IO a -> IO a #

Sets the code page for an action as necessary.

withCodePageVerbosity :: Bool -> CodePage -> IO a -> IO a #

Sets the code page for an action as necessary. If the `Bool` argument is `True`, this function will emit a warning to `stderr` indicating that the code page has been changed. (`withCodePage` sets this argument to `False`.)

type CodePage = Word32 #

A numeric type representing Windows code pages.

cp65001 :: CodePage #

The UTF-8 code page.

cp1200 :: CodePage #

The UTF-16LE code page.

cp1201 :: CodePage #

The UTF-16BE code page.

cp12000 :: CodePage #

The UTF-32LE code page.

cp12001 :: CodePage #

The UTF-32BE code page.