lua-users home
lua-l archive

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

On Tue, Apr 30, 2013 at 03:24:30PM -0700, marbux wrote:
> On Tue, Apr 30, 2013 at 5:16 AM, Rob Kendrick <> wrote:
> > Also, I'm not sure how well Lua reacts when char is not 8 bits.
> This can be problematic absent a library for handling such characters.
> For UTF-8 chars, I've yet to hit a problem using the utf-8.lua library
> with either Lua 5.1.x or 5.2.x.
> <>. Written in pure Lua, it
> provides UTF-8 aware substitutes for string.len, string.sub,
> string.reverse, string.upper, and string.lower. There are other
> solutions. See generally, <>.

I believe they're referring to DSP systems where CHAR_BIT is very often 16.
This usually doesn't effect string encodings so much as invalidate width
calculations, unsigned overflow, and a host of other stuff that most C
programmers are only vaguely familiar with.

You know it's a lost cause when you see code with `sizeof (char)', although
at least the developer gets props for trying.