X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FIO%2FEncoding%2FIconv.hs;h=faf58e9860085ef260cdc6e5443d0a30353829c9;hb=85ed71ab833a40f5acfeb4610a0aa3c3c3e1a35b;hp=1c19b00cf4b9b3ab4f28241007ab6b8d94294a52;hpb=cdc356f8844b93fc3ad8748c8e6fa6b82fa27dad;p=ghc-base.git diff --git a/GHC/IO/Encoding/Iconv.hs b/GHC/IO/Encoding/Iconv.hs index 1c19b00..faf58e9 100644 --- a/GHC/IO/Encoding/Iconv.hs +++ b/GHC/IO/Encoding/Iconv.hs @@ -194,11 +194,10 @@ iconvRecode iconv_t else do errno <- getErrno case errno of - e | e == eINVAL - || (e == e2BIG || e == eILSEQ) && new_inleft' /= (iw-ir) -> do + e | e == eINVAL || e == e2BIG + || e == eILSEQ && new_inleft' /= (iw-ir) -> do iconv_trace ("iconv ignoring error: " ++ show (errnoToIOError "iconv" e Nothing Nothing)) - -- Output overflow is relatively harmless, unless - -- we made no progress at all. + -- Output overflow is harmless -- -- Similarly, we ignore EILSEQ unless we converted no -- characters. Sometimes iconv reports EILSEQ for a @@ -211,8 +210,9 @@ iconvRecode iconv_t -- the buffer have been drained. return (new_input, new_output) - _other -> - throwErrno "iconvRecoder" + e -> do + iconv_trace ("iconv returned error: " ++ show (errnoToIOError "iconv" e Nothing Nothing)) + throwErrno "iconvRecoder" -- illegal sequence, or some other error #endif /* !mingw32_HOST_OS */