On Sat, Dec 23, 2006 at 11:05:15PM +0100, Georg Baum wrote:

> On Saturday 23 December 2006 14:36, Michael Gerz wrote:
> > Hello everybody,
> >
> > a cry for help from a desperate soul :-)
> >
> > The following bug report has been added to Status.15x. Unfortunately, I
> > don't have a debugger on Windows which makes it very hard to track the
> > problem. IIRC, the bug was introduced by one of the former unicode updates.
> 
> I think I have found the problem (at least I could reproduce it by changing 
> my 
> LANG variable from de_DE.UTF-8 to de_DE): toFilesystemEncoding() is doing the 
> wrong thing. Therefore the test fs::exists() fails, and kpsewhich returns a 
> relative name.

The problem here is that toqstr() expects an utf8 encoded argument,
whereas makeAbsPath() returns a path already in the filesystem encoding.
The attached patch solves the problem, but I don't know if it is the right
thing to do. Maybe getcwd() should be changed to return an utf8 encoded
string?

> Happy Christmas to all (even if not PC, those who do not celebrate it please 
> replace it with something appropriate)

Seems that the PC way is: Seasons Greetings to all!

-- 
Enrico
Index: src/support/filetools.C
===================================================================
--- src/support/filetools.C     (revision 16381)
+++ src/support/filetools.C     (working copy)
@@ -1107,7 +1107,7 @@ FileName const findtexfile(string const 
        // If the file can be found directly, we just return a
        // absolute path version of it.
        FileName const absfile(makeAbsPath(fil));
-       if (fs::exists(absfile.toFilesystemEncoding()))
+       if (fs::exists(absfile.absFilename()))
                return absfile;
 
        // No we try to find it using kpsewhich.
@@ -1135,10 +1135,10 @@ FileName const findtexfile(string const 
        cmd_ret const c = runCommand(kpsecmd);
 
        lyxerr[Debug::LATEX] << "kpse status = " << c.first << '\n'
-                << "kpse result = `" << rtrim(c.second, "\n")
+                << "kpse result = `" << rtrim(c.second, "\n\r")
                 << '\'' << endl;
        if (c.first != -1)
-               return FileName(os::internal_path(rtrim(c.second, "\n\r")));
+               return FileName(makeAbsPath(rtrim(c.second, "\n\r")));
        else
                return FileName();
 }

Reply via email to