diff options
author | Max Bolingbroke <batterseapower@hotmail.com> | 2011-11-02 18:13:41 +0000 |
---|---|---|
committer | Max Bolingbroke <batterseapower@hotmail.com> | 2011-11-02 18:13:41 +0000 |
commit | f2067ca807f2767b73a7eeb5c3627bafd644eaa6 (patch) | |
tree | 9206704e764f81e85f4cbd4dc3da59b983689ec2 | |
parent | de77751141cda79b35a17c07b4135b9d2540f6d4 (diff) | |
download | haskell-f2067ca807f2767b73a7eeb5c3627bafd644eaa6.tar.gz |
Fix build on Windows
-rw-r--r-- | libraries/base/GHC/IO/Encoding.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libraries/base/GHC/IO/Encoding.hs b/libraries/base/GHC/IO/Encoding.hs index 1012290a99..af0e3458ac 100644 --- a/libraries/base/GHC/IO/Encoding.hs +++ b/libraries/base/GHC/IO/Encoding.hs @@ -176,7 +176,7 @@ char8 = Latin1.latin1 -- mkTextEncoding :: String -> IO TextEncoding mkTextEncoding e = case mb_coding_failure_mode of - Nothing -> unknown_encoding + Nothing -> unknownEncodingErr e Just cfm -> mkTextEncoding' cfm enc where -- The only problem with actually documenting //IGNORE and //TRANSLIT as @@ -188,9 +188,6 @@ mkTextEncoding e = case mb_coding_failure_mode of "//TRANSLIT" -> Just TransliterateCodingFailure "//ROUNDTRIP" -> Just RoundtripFailure _ -> Nothing - - unknown_encoding = ioException (IOError Nothing NoSuchThing "mkTextEncoding" - ("unknown encoding:" ++ e) Nothing Nothing) mkTextEncoding' :: CodingFailureMode -> String -> IO TextEncoding mkTextEncoding' cfm enc = case [toUpper c | c <- enc, c /= '-'] of @@ -203,7 +200,7 @@ mkTextEncoding' cfm enc = case [toUpper c | c <- enc, c /= '-'] of "UTF32BE" -> return $ UTF32.mkUTF32be cfm #if defined(mingw32_HOST_OS) 'C':'P':n | [(cp,"")] <- reads n -> return $ CodePage.mkCodePageEncoding cfm cp - _ -> unknown_encoding + _ -> unknownEncodingErr (enc ++ codingFailureModeSuffix cfm) #else _ -> Iconv.mkIconvEncoding cfm enc #endif @@ -216,3 +213,6 @@ latin1_decode :: Buffer Word8 -> CharBuffer -> IO (Buffer Word8, CharBuffer) latin1_decode input output = fmap (\(_why,input',output') -> (input',output')) $ Latin1.latin1_decode input output --latin1_decode = unsafePerformIO $ do mkTextDecoder Iconv.latin1 >>= return.encode +unknownEncodingErr :: String -> IO a +unknownEncodingErr e = ioException (IOError Nothing NoSuchThing "mkTextEncoding" + ("unknown encoding:" ++ e) Nothing Nothing) |