##// END OF EJS Templates
fix unicode file-writing in svg2pdf
MinRK -
Show More
@@ -14,6 +14,7 b' one format to another.'
14 #-----------------------------------------------------------------------------
14 #-----------------------------------------------------------------------------
15
15
16 import base64
16 import base64
17 import io
17 import os
18 import os
18 import sys
19 import sys
19 import subprocess
20 import subprocess
@@ -73,7 +74,8 b' class SVG2PDFTransformer(ConvertFiguresTransformer):'
73
74
74 #Write fig to temp file
75 #Write fig to temp file
75 input_filename = os.path.join(tmpdir, 'figure.' + data_format)
76 input_filename = os.path.join(tmpdir, 'figure.' + data_format)
76 with open(input_filename, 'wb') as f:
77 # SVG data is unicode text
78 with io.open(input_filename, 'w', encoding='utf8') as f:
77 f.write(data)
79 f.write(data)
78
80
79 #Call conversion application
81 #Call conversion application
General Comments 0
You need to be logged in to leave comments. Login now