lua-users home
lua-l archive

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

On Sun, Jan 20, 2019 at 12:13 PM Egor Skriptunoff <> wrote:
From the perfectionism point of view, you're correct :-)
But in practice, most use cases are covered by my module.

Your claim is: "Working with UTF-8 filenames on Windows in pure Lua"
Your solution is: "Working with a subset-of-UTF-8 filenames on Windows in pure Lua, wherein the subset is selected by arcane system configuration".

Seeing this discrepancy is not perfectionism, while your "most use cases" is wishful thinking.

Here is what looks more like perfectionism: your solution seems to ignore malformed UTF-8 inputs, and that's not good.

For example, on all my computers there are no files containing Chinese characters in its filenames.
Assuming you are not speaking Chinese, I want to ask you, do you have such filenames on your machines?  ;-)

Cyrillic and Chinese were a hypothetical example. If you really care about what I have, I certainly have file names with Cyrillic and accented Latin characters. Examples from one computer:

Азбука Морзе. Прием на слух и передача на ключе. 1927г..djvu (fun)

Рисунки для выжигания ТРОЕ ИЗ ПРОСТОКВАШИНО.doc (fun)

Brevet de technicien supérieur (BTS).pdf (boring)

Übersendung_Vergütungsvereinbarung.pdf (boring)

That computer, and I think just about every Windows computer I use, has code page 1252 (Latin 1/Western European) as its system code page, which makes your solution only good for the boring stuff in my case.

My module allows a user to use its native language in filenames ON HIS OWN COMPUTER.
But it's not a good idea to have, for example, Chinese filenames on a computer where user don't speak Chinese.

What about users who speak Chinese? Should they be allowed only 7-bit ASCII in addition to Chinese?
Although it's technically possible in all modern OS, it's inconvenient for the user. 
User should be able to understand the meaning of a filename.

I certainly understand all those filenames.
(If a filename is not supposed to be human-understandable, it would be better consisted of digits/hexadecimals/GUIDs/etc. instead of human language words)

What about servers that keep files for multiple users who collectively speak a bunch of languages?

Let's face it, your solution may be good for you, but it is not good for filenames with arbitrary Unicode characters, and your further argument is akin to "640K ought to be enough for anybody"

As I said originally, there is no way to address this with a pure Lua library, but perhaps we could hope the Lua team might recognise the importance of making the built-in libraries Unicode-friendly on Windows, even if that means using non-standard IO routines.