aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2024-06-19 22:05:33 +0200
committerThijs Schreijer <thijs@thijsschreijer.nl>2024-06-19 22:05:33 +0200
commite0871d7be63dd428d4a2b9a3db4e033894165cef (patch)
tree9a844f267ec9ec99ba745680453b683dd73a6f5b /examples
parent8996a5022fa82e5d5335f71580d0cd6b6d323c9b (diff)
downloadluasystem-e0871d7be63dd428d4a2b9a3db4e033894165cef.tar.gz
luasystem-e0871d7be63dd428d4a2b9a3db4e033894165cef.tar.bz2
luasystem-e0871d7be63dd428d4a2b9a3db4e033894165cef.zip
add system.CODEPAGE_UTF8 for 65001 codepage
Diffstat (limited to 'examples')
-rw-r--r--examples/compat.lua2
-rw-r--r--examples/readline.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/compat.lua b/examples/compat.lua
index a59d964..c712105 100644
--- a/examples/compat.lua
+++ b/examples/compat.lua
@@ -12,7 +12,7 @@ if sys.windows then
12 os.getenv = sys.getenv -- luacheck: ignore 12 os.getenv = sys.getenv -- luacheck: ignore
13 13
14 -- Set console output to UTF-8 encoding. 14 -- Set console output to UTF-8 encoding.
15 sys.setconsoleoutputcp(65001) 15 sys.setconsoleoutputcp(sys.CODEPAGE_UTF8)
16 16
17 -- Set up the terminal to handle ANSI escape sequences on Windows. 17 -- Set up the terminal to handle ANSI escape sequences on Windows.
18 if sys.isatty(io.stdout) then 18 if sys.isatty(io.stdout) then
diff --git a/examples/readline.lua b/examples/readline.lua
index 286522c..ff215dd 100644
--- a/examples/readline.lua
+++ b/examples/readline.lua
@@ -442,7 +442,7 @@ local backup = sys.termbackup()
442sys.setconsoleflags(io.stdout, sys.getconsoleflags(io.stdout) + sys.COF_VIRTUAL_TERMINAL_PROCESSING) 442sys.setconsoleflags(io.stdout, sys.getconsoleflags(io.stdout) + sys.COF_VIRTUAL_TERMINAL_PROCESSING)
443sys.setconsoleflags(io.stdin, sys.getconsoleflags(io.stdin) + sys.CIF_VIRTUAL_TERMINAL_INPUT) 443sys.setconsoleflags(io.stdin, sys.getconsoleflags(io.stdin) + sys.CIF_VIRTUAL_TERMINAL_INPUT)
444-- set output to UTF-8 444-- set output to UTF-8
445sys.setconsoleoutputcp(65001) 445sys.setconsoleoutputcp(sys.CODEPAGE_UTF8)
446 446
447-- setup Posix terminal to disable canonical mode and echo 447-- setup Posix terminal to disable canonical mode and echo
448sys.tcsetattr(io.stdin, sys.TCSANOW, { 448sys.tcsetattr(io.stdin, sys.TCSANOW, {