The iconv package

[Tags: bsd3, library]

Provides an interface to the POSIX iconv library functions for string encoding conversion.

[Skip to ReadMe]


Versions0.2, 0.4,,,,,
Dependenciesbase (>=3 && <5), bytestring (>=0.9 && <0.11) [details]
Copyright(c) 2006-20015 Duncan Coutts
AuthorDuncan Coutts <>
MaintainerDuncan Coutts <>
Source repositoryhead: darcs get
UploadedMon Jun 1 09:22:17 UTC 2015 by DuncanCoutts
DistributionsDebian:, LTSHaskell:, NixOS:, Stackage:
Downloads3349 total (9 in last 30 days)
0 []
StatusDocs available [build log]
Last success reported on 2015-06-03 [all 1 reports]




Maintainers' corner

For package maintainers and hackage trustees

Readme for iconv-


This is a Haskell binding to the iconv() C library function.

The only module exported is Codec.Text.IConv, which provides a single function:

-- | Convert fromCharset toCharset input output
convert :: EncodingName -> EncodingName -> Lazy.ByteString -> Lazy.ByteString

where fromCharset and toCharset are the names of the input and output character set encodings, and input and output are the input and output text as lazy ByteStrings. For example:

 import qualified Codec.Text.IConv as IConv
 import qualified Data.ByteString.Lazy as BS
 main = do
   -- read UTF8, but convert to UTF32 internally
   content <- fmap (IConv.convert "UTF-8" "UTF-32") (BS.readFile file)

An example program, similar to the iconv program, is included.

Character set encodings

To see a list of encoding names which are known by your operating system, run iconv --list in a shell. Likely encodings are listed on the libiconv web site.

Availability of iconv()

The iconv(3) function conforms to POSIX.1-2001. It is provided by the GNU C library.

On systems which do not have a native iconv() implementation you may need to install libiconv.