]> git.lyx.org Git - features.git/commitdiff
On Windows, properly account for the encoding of the temporary directory.
authorEnrico Forestieri <forenr@lyx.org>
Tue, 6 Mar 2012 21:24:04 +0000 (21:24 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 6 Mar 2012 21:24:04 +0000 (21:24 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40875 a592a061-630c-0410-9148-cb99ea01b6c8

lib/configure.py
status.20x

index f37bfdb47fda2c936541d87aa6ee6afd456d4a12..767a7a9ab85a84883f03b20c2c622ad915c10145 100644 (file)
@@ -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):
index da525fe2d1cadd91311fe74571aeccc0e0e9120d..370f893f2db5f938687952b337f035b3058e3e31 100644 (file)
@@ -62,6 +62,9 @@ What's new
 
 - Fix pasting of LATIN CAPITAL LETTER SHARP S (bug 8057).
 
+- Fix reconfiguration on Windows when the temporary directory used by
+  python contains non-ascii characters.
+
 
 * TEX2LYX