[texworks] luatex problem with file with umlauts on windows 10

Reinhard Kotucha reinhard.kotucha at web.de
Sat Apr 25 22:33:04 CEST 2020


On 2020-04-26 at 01:08:28 +0900, Akira Kakuto wrote:

 > local function is_windows()
 >   local a = package.config:sub(1,1)
 >   if a == '/' then
 >     return false
 >   elseif a == ':' then
 >     return false
 >   else
 >     return true
 >   end
 > end

Dear Akira,
there is an easier and more comprehensible solution:

  local function is_windows()
    if os.type == 'windows' then
      return true
    end
  end

os.type is set at compile time and thus no heuristics are involved.
Possible values are 'unix', 'windows', and 'msdos'.

It's one of Taco's extensions to Lua which are very helpful when
writing platform independent scripts.

If the LaTeX3 team has to determine whether the current OS is Windows
I'm convinced that os.type is preferable because it's efficient (just
a variable lookup), no post-processing is needed, and the code is much
more comprehensible.

Regards,
  Reinhard

--
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------



More information about the texworks mailing list.