Commit 9f44c804 authored by Kristof Korwisi's avatar Kristof Korwisi
Browse files

Merge branch '112-file-encoding-utf8' into 'master'

Resolve "File Encoding not always UTF8"

Closes #112

See merge request decker/decker!49
parents 638b4ab2 2b967b9c
......@@ -247,7 +247,7 @@ writePandocFile fmt options out pandoc =
case getWriter fmt of
Right (TextWriter writePandoc, _) ->
runIOQuietly (writePandoc options pandoc) >>= handleError >>=
T.writeFile out
B.writeFile out . E.encodeUtf8
Right (ByteStringWriter writePandoc, _) ->
runIOQuietly (writePandoc options pandoc) >>= handleError >>=
LB.writeFile out
......@@ -494,7 +494,7 @@ readMetaMarkdown markdownFile = do
externalMeta <-
liftIO $ aggregateMetaData projectDir (takeDirectory markdownFile)
-- extract embedded meta data from the document
markdown <- liftIO $ T.readFile markdownFile
markdown <- liftIO $ E.decodeUtf8 <$> B.readFile markdownFile
let Pandoc meta _ = readMarkdownOrThrow pandocReaderOpts markdown
let documentMeta = MetaMap $ unMeta meta
-- combine the meta data with preference on the embedded data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment