Skip to content

Instantly share code, notes, and snippets.

@papamitra
Forked from minddnim/mojicode.hs
Last active December 31, 2015 23:49
Show Gist options
  • Save papamitra/8062724 to your computer and use it in GitHub Desktop.
Save papamitra/8062724 to your computer and use it in GitHub Desktop.
import Network.HTTP
import Data.ByteString.Lazy.Char8 as B
import Codec.Text.IConv
main :: IO()
main = do
htmlSrc <- openURL "http://flowermaster.web.fc2.com/lrnanido_sara.html"
let src = convert "CP932" "UTF-8" $ B.pack htmlSrc
B.putStrLn src
openURL :: String -> IO String
openURL x = getResponseBody =<< simpleHTTP (getRequest x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment