[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Managing Unicode (UTF-8 and UTF-16) data in Lua
- From: Philipp Janda <siffiejoe@...>
- Date: Sat, 6 Aug 2016 23:31:56 +0200
Am 06.08.2016 um 11:28 schröbte steve donovan:
On Fri, Aug 5, 2016 at 10:03 PM, Paul Moore <firstname.lastname@example.org> wrote:
It does support UTF8, you just need to set it explicitly:
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
The trick is to always use the widechar variants of the API calls, and
convert UTF-8 to UTF-16 before calling them.
AFAIK, the Apache portable runtime does it like this on Windows. There's
even a binding for Lua 5.1. APR is a bit difficult to build (especially
on Windows), but it provides many of the usual OS services you might