App: Issue NotUTF8Encoded warning when falling back to latin1.

This commit is contained in:
John MacFarlane 2021-09-08 09:30:16 -07:00
parent dee30e2a1b
commit ddfa7b2a63

View file

@ -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))