@@ -33,7 +33,7 @@ module Main where
3333import Text.Pandoc
3434import Text.Pandoc.PDF (tex2pdf)
3535import Text.Pandoc.Readers.LaTeX (handleIncludes)
36−import Text.Pandoc.Shared ( tabFilter, readDataFile, safeRead,
36+import Text.Pandoc.Shared ( tabFilter, readDataFileUTF8, safeRead,
3737 headerShift, normalize, err, warn )
3838import Text.Pandoc.XML ( toEntities, fromEntities )
3939import Text.Pandoc.SelfContained ( makeSelfContained )
@@ -889,24 +889,27 @@ main = do
889889 E.catch (UTF8.readFile tp')
890890 (\e -> if isDoesNotExistError e
891891 then E.catch
892− (readDataFile datadir $
893− "templates" </> tp')
892+ (readDataFileUTF8 datadir
893+ ("templates" </> tp'))
894894 (\e' -> let _ = (e' :: E.SomeException)
895895 in throwIO e')
896896 else throwIO e)
897897
898898 variables' <- case mathMethod of
899899 LaTeXMathML Nothing -> do
900− s <- readDataFile datadir $ "data" </> "LaTeXMathML.js"
900+ s <- readDataFileUTF8 datadir
901+ ("data" </> "LaTeXMathML.js")
901902 return $ ("mathml-script", s) : variables
902903 MathML Nothing -> do
903− s <- readDataFile datadir $ "data"</>"MathMLinHTML.js"
904+ s <- readDataFileUTF8 datadir
905+ ("data"</>"MathMLinHTML.js")
904906 return $ ("mathml-script", s) : variables
905907 _ -> return variables
906908
907909 variables'' <- if "dzslides" `isPrefixOf` writerName'
908910 then do
909− dztempl <- readDataFile datadir $ "dzslides" </> "template.html"
911+ dztempl <- readDataFileUTF8 datadir
912+ ("dzslides" </> "template.html")
910913 let dzcore = unlines $ dropWhile (not . isPrefixOf "<!-- {{{{ dzslides core")
911914 $ lines dztempl
912915 return $ ("dzslides-core", dzcore) : variables'
@@ -927,15 +930,16 @@ main = do
927930 then do
928931 csl <- CSL.parseCSL =<<
929932 case mbCsl of
930− Nothing -> readDataFile datadir "default.csl"
933+ Nothing -> readDataFileUTF8 datadir
934+ "default.csl"
931935 Just cslfile -> do
932936 exists <- doesFileExist cslfile
933937 if exists
934938 then UTF8.readFile cslfile
935939 else do
936940 csldir <- getAppUserDataDirectory "csl"
937− readDataFile (Just csldir)
938− (replaceExtension cslfile "csl")
941+ readDataFileUTF8 (Just csldir)
942+ (replaceExtension cslfile "csl")
939943 abbrevs <- maybe (return []) CSL.readJsonAbbrevFile cslabbrevs
940944 return $ Just csl { CSL.styleAbbrevs = abbrevs }
941945 else return Nothing