[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Issues: Character 160 - Non-breaking space + Additional Issue with UTF-8
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sat, 7 Jul 2018 11:02:11 -0300
> Issue #1) ---- Character 160
> Lua 5.3 is not recognizing the character 160 / 0xA0 (
> https://en.wikipedia.org/wiki/Non-breaking_space) as space inside code as
> space.
Like several other languages such as C and Java, Lua recognizes as space
inside source code only the standard ASCII spaces.
> Issue #2) ----- UTF-8
> The same character #160 when encoded as UTF-8 becomes the 2 bytes 0xC2 0xA0.
> The 0xC2 character in ISO 8859-1 (Latin-1) codification is the character "Â".
> What?
These are facts of live, derived directly from the meanings of UTF-8 and
ISO 8859-1.
> In my app, I strongly advise the users to encode their .lua file as UTF-8
> because all of my system function expects utf-8 coding as string parameter
There are no problems at all encoding .lua files as UTF-8. However,
identifiers, numerals, and whitespace are restricted to the "standard"
stuff (Latin letters, Indo-Arab numerals, and ASCII white-spaces).
-- Roberto