Skip to content

Commit

Permalink
Lua: avoid crashing when an error message is not valid UTF-8
Browse files Browse the repository at this point in the history
Invalid input bytes in error messages caused pandoc to crash with an
encoding exception. Instead, the invalid bytes are now replaced with the
Unicode replacement character U+FFFD.
  • Loading branch information
tarleb committed Feb 20, 2024
1 parent 37668ba commit 5c6a8eb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import HsLua.Packaging
import Text.Pandoc.Error (PandocError (PandocLuaError), renderError)

import qualified HsLua as Lua
import qualified Text.Pandoc.UTF8 as UTF8
import qualified HsLua.Core.Utf8 as UTF8

-- | Lua userdata type definition for PandocError.
typePandocError :: LuaError e => DocumentedType e PandocError
Expand Down

0 comments on commit 5c6a8eb

Please sign in to comment.