string.format(%q) and escape sequences
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: string.format(%q) and escape sequences
- From: Bernd Eggink <monoped@...>
- Date: 2013年8月13日 18:23:24 +0000
The documentation says, "the q option formats a string between double
quotes, using escape sequences when necessary to ensure that it can
safely be read back by the Lua interpreter".
However, this is not true if the string contains certain escape
sequences, such as 027円 or 013円:
t="027円[1maha027円[m"
t1=string.format("%q", t) --> "27円[1maha27円[m"
On an xterm in Linux print(t) prints a nice bold aha, while print(t1)
prints "27円[1maha27円[m". Is that a bug or am I missing something?
Bernd
--
http://sudrala.de