if markdown2pdf fails try without -xetex option
authorProduction Moz <dev@sopinspace.com>
Thu, 09 Jun 2011 11:52:31 +0200
changeset 357 2f4587a37ff9
parent 356 52569110fb34
child 358 3e58bf6b3f3e
if markdown2pdf fails try without -xetex option
src/cm/converters/pandoc_converters.py
--- a/src/cm/converters/pandoc_converters.py	Thu Jun 09 11:41:04 2011 +0200
+++ b/src/cm/converters/pandoc_converters.py	Thu Jun 09 11:52:31 2011 +0200
@@ -119,12 +119,15 @@
     temp_file.write(content.encode(_PANDOC_ENCODING))
     temp_file.close()
     
-    # xetex seems to cause "Invalid or incomplete multibyte or wide character" errors
-    #cust_tex = " --xetex "
-    cust_tex = ''
+    cust_tex = " --xetex "
     
     # use markdown2pdf
     retcode = call(MARKDOWN2PDF_BIN + cust_tex + ' ' + input_temp_name, shell=True, stderr=fp_error)
+
+    # xetex seems to randomly cause "Invalid or incomplete multibyte or wide character" errors, try without it
+    if retcode:
+      retcode = call(MARKDOWN2PDF_BIN + ' ' + input_temp_name, shell=True, stderr=fp_error)
+
     fp_error.close()
     
     fp_error = file(error_temp_name)