Friends,
   I have taken complete examination and test for this problem,
found the following information:

1. Qt 4.4 has fixed several locale related problems, so now lyx
is able to handle any files with non-ASCII chars in filename.
This is true on Windows XP systems. I do not know the effect
on other systems. May someone test it on Linux?

2. Even with Qt 4.4, tex2lyx has problem handling non-ASCII
chars in filename. According to MS document, the system default
to set the locale as "C", which cannot handle non-ASCII chars
in filename. So the fix is quite simple: call setlocale with proper
locale string. According to MS document, the string ""
(i.e, a 0-length string) implies the system default ANSI codepage.
So, the following one line code will fix the problem:

setlocale(LC_ALL,"");

I have tested on Windows and it works. The attached patch
will add this call at proper position.

Because setlocale() is a standard C library function, it should
be supported under other systems. So it may also fix this problems
on other systems like Linux. Could anyone test it? I do not have
the environment.

As this tiny patch will fix the problem, my old large ugly patch
will be dropped for sure.

Finally the link to the MS document:
http://msdn.microsoft.com/en-us/library/x99tb11d(VS.71).aspx

Regards,
Hangzai

Attachment: fileFixNonASCII.patch
Description: Binary data

Reply via email to