I am parsing utf8-encoded pages using hxt, simplified parser example:
names = multi (hasName "h1") >>> proc h1 do
name <- getText <<< getChildren -< h1
returnA name
Everything goes normal until I try to print names:
*Main > n
"\208\152\208\182\208\190\209\128\208\176-\208\161"
*Main > :t n
n :: String
*Main > putStrLn n
ÐжоÑа-С
*Main > Data.Text.IO.putStrLn $ Data.Text.pack n
ÐжоÑа-С
I am parsing using option withInputEncoding "utf8"
.
How is it possible to properly encode string parsed by hxt?