diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-09-08 09:30:16 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-09-08 09:30:16 -0700 |
commit | ddfa7b2a630bd123c7b6291769c6ae1fe347aff4 (patch) | |
tree | f6971d2cc25010cc8aa3c71d1495d8ce27b16cb7 /src/Text/Pandoc/App.hs | |
parent | dee30e2a1b455650dbbbec3bfab3dda43582a5fe (diff) | |
download | pandoc-ddfa7b2a630bd123c7b6291769c6ae1fe347aff4.tar.gz |
App: Issue NotUTF8Encoded warning when falling back to latin1.
Diffstat (limited to 'src/Text/Pandoc/App.hs')
-rw-r--r-- | src/Text/Pandoc/App.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index f7c1f218d..b639a97b7 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -426,8 +426,12 @@ inputToText convTabs (fp, (bs,mt)) = Nothing -> catchError (utf8ToText fp bs) (\case - PandocUTF8DecodingError{} -> - return $ T.pack $ B8.unpack bs + PandocUTF8DecodingError{} -> do + report $ NotUTF8Encoded + (if null fp + then "input" + else fp) + return $ T.pack $ B8.unpack bs e -> throwError e) inputToLazyByteString :: (FilePath, (BS.ByteString, Maybe MimeType)) |