From: Enrico Forestieri Date: Mon, 5 Mar 2012 17:14:09 +0000 (+0000) Subject: On Windows, properly account for the encoding of the temporary directory. X-Git-Tag: 2.1.0beta1~1992 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=85ccfd240c3818f73e1a2064c6010300f00e2241;p=features.git On Windows, properly account for the encoding of the temporary directory. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40858 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/configure.py b/lib/configure.py index ae987ef63f..f88d51966a 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -109,9 +109,13 @@ def checkTeXPaths(): from tempfile import mkstemp fd, tmpfname = mkstemp(suffix='.ltx') if os.name == 'nt': + from locale import getdefaultlocale from ctypes import windll, create_unicode_buffer GetShortPathName = windll.kernel32.GetShortPathNameW - longname = unicode(tmpfname) + language, encoding = getdefaultlocale() + if encoding == None: + encoding = 'latin1' + longname = unicode(tmpfname, encoding) shortlen = GetShortPathName(longname, 0, 0) shortname = create_unicode_buffer(shortlen) if GetShortPathName(longname, shortname, shortlen):