Skip to content

Instantly share code, notes, and snippets.

@kazu-yamamoto
Created January 7, 2014 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazu-yamamoto/8298153 to your computer and use it in GitHub Desktop.
Save kazu-yamamoto/8298153 to your computer and use it in GitHub Desktop.
Text as euc-jp
{-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified Data.Text as T
import qualified Data.Text.IO as T
import System.IO
main :: IO ()
main = do
withFile "foo" WriteMode $ \hdl -> do
enc <- mkTextEncoding "euc-jp"
hSetEncoding hdl enc
T.hPutStrLn hdl "テスト"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment