diff options
author | Thijs Schreijer <thijs@thijsschreijer.nl> | 2024-06-19 22:05:33 +0200 |
---|---|---|
committer | Thijs Schreijer <thijs@thijsschreijer.nl> | 2024-06-19 22:05:33 +0200 |
commit | e0871d7be63dd428d4a2b9a3db4e033894165cef (patch) | |
tree | 9a844f267ec9ec99ba745680453b683dd73a6f5b /examples | |
parent | 8996a5022fa82e5d5335f71580d0cd6b6d323c9b (diff) | |
download | luasystem-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.lua | 2 | ||||
-rw-r--r-- | examples/readline.lua | 2 |
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() | |||
442 | sys.setconsoleflags(io.stdout, sys.getconsoleflags(io.stdout) + sys.COF_VIRTUAL_TERMINAL_PROCESSING) | 442 | sys.setconsoleflags(io.stdout, sys.getconsoleflags(io.stdout) + sys.COF_VIRTUAL_TERMINAL_PROCESSING) |
443 | sys.setconsoleflags(io.stdin, sys.getconsoleflags(io.stdin) + sys.CIF_VIRTUAL_TERMINAL_INPUT) | 443 | sys.setconsoleflags(io.stdin, sys.getconsoleflags(io.stdin) + sys.CIF_VIRTUAL_TERMINAL_INPUT) |
444 | -- set output to UTF-8 | 444 | -- set output to UTF-8 |
445 | sys.setconsoleoutputcp(65001) | 445 | sys.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 |
448 | sys.tcsetattr(io.stdin, sys.TCSANOW, { | 448 | sys.tcsetattr(io.stdin, sys.TCSANOW, { |