luatex problem with file with umlauts on windows 10

Akira Kakuto kakuto at w32tex.org
Sat Apr 25 18:08:28 CEST 2020


Dear Philip,

TeXworks expects UTF-8 for console-log.
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 ofile =  kpse.find_file(name, "tex", true)
  local file = ofile
  if is_windows() and is_texlive() then
    local g = chgstrcp.utf8tosyscp(file)
    file = g
  end
  print("\string\nFILE: ",ofile)
  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.