lua-users home
lua-l archive

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

In working with the Lua string library, there are basically two options:

1. Pick an encoding that only uses single-byte characters and that is
compatible with 7-bit ASCII. ISO Latin-1 meets this requirement, I believe.
Pretty much everything should be able to work properly in that case.

2. Use something like UTF-8 that is also compatible with ASCII but recognize
that things that look like single characters may no longer be single
characters and that functions like string.upper, etc. probably won't be
reliable. The nice thing about UTF-8 unlike some other varying byte-width
encoding schemes is that pieces of multi-byte characters do not look like
ASCII so string operations working on ASCII will still do the right thing.