lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi!

If you are creating portable Lua script (Linux/Windows/MacOS)
then you have a problem: standard Lua functions such as "io.open"
expect a filename encoded in UTF-8 on all "normal OS",
but on Windows a filename must be in some Windows-specific encoding
depending on the locale.

There is a pure Lua solution to this problem.

https://gist.github.com/Egor-Skriptunoff/2458547aa3b9210a8b5f686ac08ecbf0

This module checks OS, and if Windows is detected,
all filename-related standard Lua functions (they are 11)
are modified to accept filenames in UTF-8.

-- Egor