[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: accented characters in field names (once more)
- From: Mike Pall <mikelu-0611@...>
- Date: Sat, 25 Nov 2006 13:14:24 +0100
Hi,
manel wrote:
> Why the interactive lua works differently than the non-interactive one
> (in this subject)?
The readline library (used for reading from the interactive
prompt) initializes the locale from the environment variables as
a side effect. This doesn't happen in non-interactive mode.
> What is the solution?
$ lua -e 'í=1; print(í)'
lua: (command line):1: unexpected symbol near 'í'
$ export LUA_INIT='os.setlocale(os.getenv("LC_CTYPE"), "ctype")'
$ lua -e 'í=1; print(í)'
1
Or put this line into a script which is loaded first. This script
must not contain any non-ASCII identifiers because it's parsed
completely before it's run. But any subsequently parsed files
(dofile, loadfile, require etc.) are allowed to contain NLS
characters in identifiers.
Bye,
Mike