lua-users home
lua-l archive

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

On Sunday, January 11, 2015, tjhack <> wrote:

Hi all,

I convert some lua script(it contains chinese character) from simplified chinese to traditional chinese, and now the chinese character is encoding with cp950.

Now I switch my win7 machine locale to zh_TW, and restart. Everything seems okay, the script with traditional chinese character is correct displayed.

But when I complied these script.It is error.Invalid escape string.

for example:


the result is:


Look at the hex of the string, it is


so it is the lua not escape the string.

Baking the literal string into the source file is not a good idea anyways, and apparently, Lua parser is not compatible with encoding that's not ASCII compatible.

I would suggest put the string into a separate lookup file which can be encoded and preprocessed so Lua can read them. 

Now the problem is, can I solve it? How can I let the script compile success? My source script can not encoding into utf-8, if can, it is esay.