lua-users home
lua-l archive

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

On Fri, Aug 5, 2016 at 10:03 PM, Paul Moore <> wrote:
>> It does support UTF8, you just need to set it explicitly:
>> winapi.set_encoding(winapi.CP_UTF8).
>> It will then be passed to MultiByteToWideChar, WideCharToMultiByte,
>> and other calls.
> Ah cool, I hadn't spotted that. It's not so important for my code to
> handle multiple encodings, though, so I'll probably just stick to
> UTF-8.

The trick is to always use the widechar variants of the API calls, and
convert UTF-8 to UTF-16 before calling them.

Sure, there will be some overhead, but might be useful to measure the
impact before designing around a problem which isn't a problem.

You are always free to regard the code as a source of spare parts ;)