code-page-0.2.1: Windows code page library for Haskell
Copyright(C) 2018 Ryan Scott
LicenseBSD-style (see the file LICENSE)
MaintainerRyan Scott
StabilityExperimental
PortabilityPortable
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.IO.CodePage.Internal

Description

Various internals used by System.IO.CodePage.

Note that this is an internal module, and as such, the API presented here is not guaranteed to be stable, even between minor releases of this library.

Synopsis

Documentation

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.

cp1252 :: CodePage #

The Latin1 code page.

data Options #

Options that specify how withCodePage and friends should work.

Constructors

Options 

Fields

  • chatty :: Bool

    If True, emit a warning to stderr indicating that the code page has been changed. If False, don't emit any warnings.

  • nonWindowsBehavior :: NonWindowsBehavior

    Configures how withCodePage and friends should work on non-Windows operating systems.

data NonWindowsBehavior #

Specifies how withCodePage and friends should work on operating systems other than Windows.

Constructors

NonWindowsDoNothing

Don't do anything at all on non-Windows OSes.

NonWindowsFallbackCodePageEncoding (CodePage -> TextEncoding)

On non-Windows OSes, change the TextEncoding by converting the CodePage argument to a TextEncoding using the supplied function.

nonWindowsDoNothing :: NonWindowsBehavior #

Don't do anything at all on non-Windows OSes.

nonWindowsFallbackCodePageEncoding :: (CodePage -> TextEncoding) -> NonWindowsBehavior #

On non-Windows OSes, change the TextEncoding by converting the CodePage argument to a TextEncoding using the supplied function.

defaultFallbackCodePageEncoding :: CodePage -> TextEncoding #

Provides a best-effort attempt to convert a CodePage to a TextEncoding on non-Windows OSes. Errors if given a CodePage that it doesn't know how to convert.