lua-users home
lua-l archive

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


On 06/30/2011 10:37 AM, steve donovan wrote:

There's things like '_mbslen' (mbs for 'multi-byte string'); UTF-8 is
definitely encouraged if you don't go wide.


Unfortunately, Microsoft's _setmbcp does not support UTF-8 (nor UTF-7). It's like they want to make things more difficult for us.

You could redefine Lua to use wchar_t in strings. And that's why I mentioned escapes greater than 255. As more than one person pointed out, I confused sizeof() with CHAR_BIT. Well, you could "#define char int" but that would be cheating. Or not? I see a few "sizeof(char)" in the Lua source. But it does assume that "char" has not been redefined in other places. It does test against UCHAR_MAX but with the assumption that it is less than 1000. (Only three decimal digits or two hexadecimal.)

--
- tom
telliamed@whoopdedo.org