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

Dmitry Bogatov KAction at gnu.org
Wed Aug 6 12:14:13 UTC 2014


* Danilov Alexander <danilovalexalex at yandex.ru> [2014-08-06 09:25:54+0400]
> 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

Problem is that I have XML file from unknown source. I do not know
encoding A-priori, it's specified in file itself. And to get it, I need
to parse XML.

--
Best regards, Dmitry Bogatov <KAction at gnu.org>,
Free Software supporter, esperantisto and netiquette guardian.
GPG: 54B7F00D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140806/6ecaebaf/attachment.sig>


More information about the Haskell-Cafe mailing list