luatex problem with file with umlauts on windows 10

Akira Kakuto kakuto at w32tex.org
Sat Apr 25 16:52:25 CEST 2020


Dear Ulrike,

lua part is not utf-8 in TeX Live Windows. Please try:

% UTF-8
\directlua{
local function is_texlive()
  local a = kpse.var_value('command_line_encoding')
  if a then
    return true
  else
    return false
  end
end
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
function myfilesize(name)
  local file =  kpse.find_file(name, "tex", true)
  -- file is utf-8
  if is_windows() and is_texlive() then
    local g = chgstrcp.utf8tosyscp(file)
    file = g
  end
  -- file is local CP
  print("\string\nFILE: ",file)
  if file then
    local size = lfs.attributes(file, "size")
    local isfile= lfs.isfile (file)
    print("SIZE: ",size)
    print("isfile ", isfile)
  end
end}
\input{grüße}
\directlua{myfilesize("grüße.tex")}
\bye

Best,
Akira



More information about the tex-live mailing list.