[Haskell-cafe] [OBORONA-SPAM] Dealing with encodings

Danilov Alexander danilovalexalex at yandex.ru
Wed Aug 6 05:25:54 UTC 2014


05.08.2014 16:00, Dmitry Bogatov пишет:
> Hello!
>
> How teach hxt to handle "KOI8-R" encoding of input file?
>
> And it seems that so many great packages (like hxt, feed, curl) uses String.
> Is it some work in progress to port them to Text?
> Prelude> :search encoding
Prelude> :search encoding
Searching for: encoding
package encoding
Data.Text.Encoding module Data.Text.Encoding
Data.Text.Lazy.Encoding module Data.Text.Lazy.Encoding
GHC.IO.Encoding module GHC.IO.Encoding
System.IO hGetEncoding :: Handle -> IO (Maybe TextEncoding)
GHC.IO.Handle hGetEncoding :: Handle -> IO (Maybe TextEncoding)
System.IO hSetEncoding :: Handle -> TextEncoding -> IO ()
GHC.IO.Handle hSetEncoding :: Handle -> TextEncoding -> IO ()
System.IO localeEncoding :: TextEncoding
GHC.IO.Encoding localeEncoding :: TextEncoding
System.IO mkTextEncoding :: String -> IO TextEncoding
GHC.IO.Encoding mkTextEncoding :: String -> IO TextEncoding

You can read file in any encoding available in system and later convert it into Text.



More information about the Haskell-Cafe mailing list