aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-04-04 10:07:56 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-04-04 10:07:56 -0700
commitfa0f73aef9d9ff3ca89c1479e3644ac7e7c15991 (patch)
tree529db61b94e1708cda1162ea61f77b169a8b7b22 /src/Text
parent4ee92dce0ce624db2d02c60ae2856a70cfeb6c42 (diff)
downloadpandoc-fa0f73aef9d9ff3ca89c1479e3644ac7e7c15991.tar.gz
Custom writer: read lua script as UTF-8.
This should fix #1189.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Writers/Custom.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Custom.hs b/src/Text/Pandoc/Writers/Custom.hs
index 0234e1e35..0d58afb61 100644
--- a/src/Text/Pandoc/Writers/Custom.hs
+++ b/src/Text/Pandoc/Writers/Custom.hs
@@ -37,6 +37,7 @@ import Data.Char ( toLower )
import Scripting.Lua (LuaState, StackValue, callfunc)
import qualified Scripting.Lua as Lua
import Text.Pandoc.UTF8 (fromString, toString)
+import qualified Text.Pandoc.UTF8 as UTF8
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as C8
import Data.Monoid
@@ -131,7 +132,7 @@ instance StackValue MetaValue where
-- | Convert Pandoc to custom markup.
writeCustom :: FilePath -> WriterOptions -> Pandoc -> IO String
writeCustom luaFile opts doc = do
- luaScript <- readFile luaFile
+ luaScript <- UTF8.readFile luaFile
lua <- Lua.newstate
Lua.openlibs lua
Lua.loadstring lua luaScript "custom"