[luatex] Accented characters on Windows / lfs

Hans Hagen j.hagen at xs4all.nl
Fri Sep 28 12:06:14 CEST 2018


On 9/28/2018 9:19 AM, Patrick Gundlach wrote:
> Hello all,
> 
> I have a problem with Windows, accented characters and lfs.
> 
> My code is something like this:
> 
> 
> for entry in lfs.dir(dir) do
>    ...
> end
> 
> and I have a file named 'cöw.pdf'
> 
> (LATIN SMALL LETTER O WITH DIAERESIS, U+00F6)
> 
> and the "entry" variable above has the bytes
> 
> 63 F6 77 2E 70 64 66
> c  ö  w  .  p  d  f
> 
> 
> So the ö is encoded as F6.
> 
> Is it possible to get utf8 encoding there? Or do I need a mapping such as:
> 
> filename on disk -> utf8 -> filename on disk (for file access)?
> 
> Any advice on this topic?
afaik windows has no utf filenames, so when i save a file with that name 
i get

  cöw.txt

(internally i think names become unicode16 and display depends on the 
code page)

so, if you see

63 F6 77 2E 70 64 66

that's just bytes ... so you nee to recode

i'll mail you a solution

Hans




-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


More information about the luatex mailing list