diff -up HsLocale.orig/CWString.hsc HsLocale/CWString.hsc
--- HsLocale.orig/CWString.hsc	2005-01-19 10:24:53.000000000 +0900
+++ HsLocale/CWString.hsc	2005-01-20 00:07:56.655051200 +0900
@@ -21,6 +21,8 @@ module CWString (
     peekCStringLen,
     peekCString,
     charIsRepresentable,
+    stringToBytes,
+    bytesToString,
     module CWStringBasic
 
 
@@ -38,7 +40,7 @@ import GHC.Exts
 import IO
 import CWStringBasic
 
-#if !defined(__STDC_ISO_10646__)
+#if !defined(__STDC_ISO_10646__) && !defined(__MINGW32__)
 import IConv
 #endif
 
@@ -80,7 +82,7 @@ pairLength  = flip (,) . length
 {-# INLINE wcharIsUnicode #-}
 wcharIsUnicode :: Bool
 
-#if defined(__STDC_ISO_10646__)
+#if defined(__STDC_ISO_10646__) || defined(__MINGW32__)
 
 wcharIsUnicode = True
 
@@ -246,7 +248,11 @@ withCString s a = withCWString s $ \wcs 
 withCStringLen s a = withCWString s $ \wcs -> allocaArray0 alen (\cs -> wcsrtombs wcs (cs,fi alen) >>= \sz -> a (cs,fi sz)) where
     alen = mb_cur_max * length s
 
+stringToBytes :: String -> IO [Word8]
+stringToBytes xs = withCStringLen xs $ \(cp,len) -> peekArray len (castPtr cp)
 
+bytesToString :: [Word8] -> IO String
+bytesToString xs = withArray xs $ \cp -> peekCStringLen (castPtr cp, length xs)
 
 #else
 
diff -up HsLocale.orig/LocaleIO.hs HsLocale/LocaleIO.hs
--- HsLocale.orig/LocaleIO.hs	2005-01-19 09:31:29.000000000 +0900
+++ HsLocale/LocaleIO.hs	2005-01-20 00:17:41.726342400 +0900
@@ -14,7 +14,7 @@ module LocaleIO(
 import Prelude hiding(putStr, putStrLn)
 import qualified Prelude
 import IO hiding(putStr, putStrLn)
-import IConv
+import CWString
 import System
 import Char
 
diff -up HsLocale.orig/Main.hs HsLocale/Main.hs
--- HsLocale.orig/Main.hs	2005-01-19 09:31:29.000000000 +0900
+++ HsLocale/Main.hs	2005-01-20 00:20:53.381929600 +0900
@@ -4,7 +4,6 @@ import Data.Tree
 import Random
 import Control.Monad
 import Char
-import IConv
 import CWString
 import Word
 import qualified LocaleIO
diff -up HsLocale.orig/Makefile HsLocale/Makefile
--- HsLocale.orig/Makefile	2005-01-19 10:21:34.000000000 +0900
+++ HsLocale/Makefile	2005-01-20 00:22:05.315364800 +0900
@@ -1,6 +1,9 @@
-try: Main.hs CWString.hs IConv.hs CWString_hsc.o
+try: Main.hs CWString.hs CWString_hsc.o IConv.hs 
 	ghc --make Main.hs CWString_hsc.o -o $@ 
 
+try.exe: Main.hs CWString.hs CWString_hsc.o
+	ghc --make Main.hs CWString_hsc.o -lmsvcp60 -o $@ 
+
 www-publish: CWString.hs IConv.hs
 
 HSC2HS = hsc2hs
