[texworks] TeXworks through TeX Live on Windows with multi-byte username

KUROKI Yusuke kuroky at users.sourceforge.jp
Tue Jan 6 15:17:30 CET 2015


Hi, Stefan,

Thank you for understanding the problem, but in my environment,
it is not good enough.  I will describe some test cases below.
The OS of mine is Japanese version of Windows 7 SP1, 64bit.

Basically, if TW_INIPATH does not exist, %USERPROFILE%\TeXworks is used,
otherwise (i.e., if TW_INIPATH exists), TW_INIPATH is used.

Case 1) TW_LIBPATH = TW_INIPATH = C:\temp\Löffler\texworks
The above basic description occurs.
If I use TL2014 binary (direct access to bin\win32\texworks.exe),
it creates C:\temp\Loffler\texworks, but it could not read the
directory as you guess.
The another point is, not ö but simple o. (I think this is OS'es
restriction in encoding or something)
In this situation, when I execute the updated binary,
the binary successfully access C:\temp\Loffler\texworks .

Case 2) TW_LIBPATH = TW_INIPATH = C:\temp\ああああ\texworks
The above basic description occurs.
If I use TL2014 binary (direct access to bin\win32\texworks.exe),
it creates C:\temp\ああああ\texworks, but it could not read the directory
as you guess.
In this situation, when I execute the updated binary,
the binary successfully access C:\temp\ああああ\texworks .

Thanks,
-- Yusuke.



2015-01-06 1:52 GMT+09:00 Stefan Lo"ffler <st.loeffler at gmail.com>:
> Hi,
>
> thank you for reporting this issue (and analyzing it in detail). I will
> make some comments below.
>
> On 02.01.2015 15:00, KUROKI Yusuke wrote:
>> When the user name has Japanese
>> character(s), the beginning of the procedure of TeXwork's initial
>> procedure might use
>>   %USERPROFILE%\.texlive????\texmf-config\texworks
>> as the user's configure setting (and create the directory if not existing);
>> however, the later process might not uses the directory but uses
>>   %USERPROFILE%\TeXworks
>> as its setting.  The latter place is the default setting of the
>> TeXworks stand alone which means directly executing
>> tlpkg/texwoks/texworks.exe
>
> Yes. The latter one is the default. There are two possibilities why this
> is chosen.
> 1) it is not overridden (by config files, environment variables, etc.)
> 2) it is overridden, but the override directory is not recognized/does
> not exist/is not readable.
>
> >From you analysis below, I assume it's reason 2 in your case.
>
>> We are reading some of the codes of TeXworks rapidly,
>> and guess this behavior comes from Qt library, but it is not
>> sure whether it is under control of the developer's thought.
>>   The source code which I have read is
>>     /svn/texlive/trunk/Master/source/texworks-0.4.4-r1004.tar.gz .
>>   You would concentrate Lines 144--149 and 886 in src/TWApp.cpp .
>
> The lines around 149 are indeed the ones responsible for reading the
> environment variables that override where settings and resources are
> located.
> Line 886 calls another function that should return the path to the
> configuration, but it does not read the environment variables anymore
> (that is done around line 149).
> There are a few other places where environment variables are read, but
> they should not influence your specific issue (though it might, e.g.,
> influence which scripting plugins are found, etc.).
>
>>   You could reproduce the problem by override the TW_LIBPATH
>>   in texmf.cnf (under CP932 encoding) as
>>   -  TW_LIBPATH = $TEXMFCONFIG/ああああ/texworks
>>      ... C:\Users\<USERNAME>\texworks would be used for user setting.
>>      though C:\Users\<USERNAME>\.texlive2014\ああああ\texworks
>>      would be natural.
>>   - TW_LIBPATH = $TEXMFCONFIG/だめと噂の名/texworks
>>     ... C:\Users\<USERNAME>\texworks would be used too.
>>
>> Is the behavior intended?
>
> No. This was a problem with how environment variables were read. It
> should be fixed in r1392. Note that it might take a while (possibly even
> to the next release) before TeXLive picks this up.
> In any case, this should fix the environment variable issue, i.e., if
> you set TW_LIBPATH as environment variable and then run the new version
> of TeXworks (not the TeXLive wrapper). I don't know exactly how the
> TeXLive wrapper works, but my guess is that they work via (temporarily)
> setting the environment variables. If that is indeed the case (and they
> use the right, i.e., system encoding), the problem should be resolved now.
>
> Note that I only tested this with my (German) version of Windows. It
> would be great if you could let me know if it works for you (with
> manually setting the environment variables) with the new version
> (available for testing at
> https://drive.google.com/folderview?id=0B5iVT8Q7W44pNDlQVm9uRGpEWHc&tid=0B5iVT8Q7W44pMkNLblFjUzdQUVE
> ).
>
>> Could you fix the difference whether TW_INIPATH has
>> multi-bytes characters (e.g., ああああ or だめと噂の名)?
>
> This should be fixed as well in r1392.
>
> Best,
> Stefan



-- 
黒木 裕介 (KUROKI Yusuke)



More information about the texworks mailing list