diff options
| author | ruki <[email protected]> | 2020-05-07 22:45:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-05-07 10:32:31 +0800 |
| commit | ca238c29d3e14b0c72787b47588b979356dd9410 (patch) | |
| tree | accec9b30f7b057b9bfbf9cf9e5985d5060232db /core/src | |
| parent | 5d22635894f2b19f49441e0671ac0eb1b1da9c17 (diff) | |
update ui
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/lcurses/lcurses.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/lcurses/lcurses.c b/core/src/lcurses/lcurses.c index 822bd3cf8..4844dd000 100644 --- a/core/src/lcurses/lcurses.c +++ b/core/src/lcurses/lcurses.c @@ -72,6 +72,10 @@ Notes: #include <curses.h> #include <signal.h> +#if defined(NCURSES_VERSION) +#include <locale.h> +#endif + #if defined(PDCURSES) && (PDC_BUILD < 3100) # error Please upgrade to PDCurses 3.1 or later #endif @@ -2345,6 +2349,14 @@ int xm_curses_register (lua_State *L) lua_pushcclosure(L, lc_initscr, 1); lua_settable(L, -3); + /* Since version 5.4, the ncurses library decides how to interpret non-ASCII data using the nl_langinfo function. + * That means that you have to call setlocale() in the application and encode Unicode strings using one of the system’s available encodings. + * + * And we need link libncursesw.so for drawing vline, hline characters + */ +#if defined(NCURSES_VERSION) + setlocale(LC_ALL, ""); +#endif return 1; } |
