X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fscripts%2Ffig2pdftex.py;h=e20b2ad06b32e92169113cdc69af643de1c7da61;hb=f9f7c4a4bdab64ea5a0f31cbf7c2da68b2be9a68;hp=19207d107baefe5e64ef280b3d3042045022361a;hpb=cff50172f32f3f9203155790c67601225ea1e354;p=lyx.git diff --git a/lib/scripts/fig2pdftex.py b/lib/scripts/fig2pdftex.py index 19207d107b..e20b2ad06b 100644 --- a/lib/scripts/fig2pdftex.py +++ b/lib/scripts/fig2pdftex.py @@ -28,7 +28,7 @@ # -import os, sys, re, locale +import os, sys, re def runCommand(cmd): @@ -44,12 +44,7 @@ def runCommand(cmd): if len(sys.argv) != 3: sys.exit(1) -language, output_encoding = locale.getdefaultlocale() -if output_encoding == None: - output_encoding = 'latin1' - -input = unicode(sys.argv[1], 'utf8').encode(output_encoding) -output = unicode(sys.argv[2], 'utf8').encode(output_encoding) +input, output = sys.argv[1:] # Fail silently if the file doesn't exist if not os.path.isfile(input): @@ -83,7 +78,7 @@ else: # The generated PostScript commands are extracted from epstopdf, distributed # with tetex. epsfile = outbase + '.pstex' - tmp = open(epsfile + '.??', 'w') + tmp = mkstemp() boundingboxline = re.compile('%%BoundingBox:\s+(\d*)\s+(\d*)\s+(\d*)\s+(\d*)') for line in open(epsfile).xreadlines(): if line[:13] == '%%BoundingBox':