mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
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
This commit is contained in:
parent
9c5a8b3224
commit
85ccfd240c
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user