[Fencommits] fenfire-hs: encode the input to LaTeX in utf-8

Tuukka Hastrup Tuukka.Hastrup at iki.fi
Sun Mar 11 23:51:25 EET 2007


Sun Mar 11 23:51:03 EET 2007  Tuukka Hastrup <Tuukka.Hastrup at iki.fi>
  * encode the input to LaTeX in utf-8
diff -rN -u old-fenfire-hs/Latex2Png.hs new-fenfire-hs/Latex2Png.hs
--- old-fenfire-hs/Latex2Png.hs	2007-03-11 23:51:24.000000000 +0200
+++ new-fenfire-hs/Latex2Png.hs	2007-03-11 23:51:24.000000000 +0200
@@ -29,12 +29,19 @@
 
 import Control.Monad (when)
 
+import System.Glib.UTFString (newUTFString, readCString)
+import System.IO.Unsafe (unsafePerformIO)
+
+-- XXX real toUTF isn't exported from System.Glib.UTFString
+toUTF :: String -> String
+toUTF s = unsafePerformIO $ newUTFString s >>= readCString
+
 latex content = unlines [
     "\\documentclass[12pt]{article}",
     "\\pagestyle{empty}",
     "\\usepackage[utf8]{inputenc}",
     "\\begin{document}",
-    content,
+    toUTF content,
     "\\end{document}"
     ]
 




More information about the Fencommits mailing list