[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Unicode escape sequences?
- From: Bernd Eggink <monoped@...>
- Date: Sat, 03 Dec 2011 11:51:42 +0100
On 03.12.2011 06:09, Stuart P. Bentley wrote:
As Petite mentioned, you can include any > 0x7F character in a
single-byte Lua string unescaped (which includes the bytes of all
extended characters in UTF-8).
If you want to escape Unicode characters, how depends on what byte
encoding you want the character to be in. If you're using UTF-8
(generally the most sensible choice), you can include U+2500 as
\226\148\128 (or \xe2\x94\x80 in 5.2).
thanks for your long answer. Yes, I'm using UTF-8 on my system, so the
whole thing isn't a real problem. I can always open a UTF-8 table in a
browser, copy the character I'm interested in, switch back to the editor
window, and paste it into my source. But I would rather avoid this
tedious procedure. Bash, for example, allows the notation \uxxxx, which
is very convenient. However, the octal notation you mention is OK as
well (I didn't realise that the unicode tables in
http://www.utf8-chartable.de can be switched from hex to octal).