From e0871d7be63dd428d4a2b9a3db4e033894165cef Mon Sep 17 00:00:00 2001 From: Thijs Schreijer Date: Wed, 19 Jun 2024 22:05:33 +0200 Subject: add system.CODEPAGE_UTF8 for 65001 codepage --- examples/compat.lua | 2 +- examples/readline.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') 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 os.getenv = sys.getenv -- luacheck: ignore -- Set console output to UTF-8 encoding. - sys.setconsoleoutputcp(65001) + sys.setconsoleoutputcp(sys.CODEPAGE_UTF8) -- Set up the terminal to handle ANSI escape sequences on Windows. 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() sys.setconsoleflags(io.stdout, sys.getconsoleflags(io.stdout) + sys.COF_VIRTUAL_TERMINAL_PROCESSING) sys.setconsoleflags(io.stdin, sys.getconsoleflags(io.stdin) + sys.CIF_VIRTUAL_TERMINAL_INPUT) -- set output to UTF-8 -sys.setconsoleoutputcp(65001) +sys.setconsoleoutputcp(sys.CODEPAGE_UTF8) -- setup Posix terminal to disable canonical mode and echo sys.tcsetattr(io.stdin, sys.TCSANOW, { -- cgit v1.2.3-55-g6feb