diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/AppHdr.h | 4 | ||||
-rw-r--r-- | crawl-ref/source/libunix.cc | 2 | ||||
-rw-r--r-- | crawl-ref/source/makefile.unix | 9 |
3 files changed, 14 insertions, 1 deletions
diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index 115a51186d..64440ba36c 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -259,6 +259,10 @@ #error You can use either REGEX_POSIX or REGEX_PCRE, or neither, but not both. #endif +#if defined(UNICODE_GLYPHS) && !defined(UNICODE_LOCALE) +#define UNICODE_LOCALE "en_US.UTF-8" +#endif + // ========================================================================= // Debugging Defines // ========================================================================= diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc index 2349c12f05..1f8f1d67f9 100644 --- a/crawl-ref/source/libunix.cc +++ b/crawl-ref/source/libunix.cc @@ -217,7 +217,7 @@ static void termio_init() tcsetattr(0, TCSAFLUSH, &game_term); #ifdef UNICODE_GLYPHS - if ((crawl_state.unicode_ok = !!setlocale(LC_ALL, ""))) + if ((crawl_state.unicode_ok = !!setlocale(LC_ALL, UNICODE_LOCALE))) { crawl_state.glyph2strfn = unix_glyph2string; crawl_state.multibyte_strlen = unix_multibyte_strlen; diff --git a/crawl-ref/source/makefile.unix b/crawl-ref/source/makefile.unix index f8211891d8..1df5f96ba7 100644 --- a/crawl-ref/source/makefile.unix +++ b/crawl-ref/source/makefile.unix @@ -21,6 +21,11 @@ OS_TYPE = UNIX # libncursesw available. UNICODE_GLYPHS = n +# If you're using UNICODE_GLYPHS=y, and have a preferred Unicode +# (UTF-8) locale you want Crawl to use, you can set it here. The +# default is en_US.UTF-8. +UNICODE_LOCALE = + # If you have lex and yacc, set DOYACC to y (lowercase y). DOYACC := y @@ -54,6 +59,10 @@ INCLUDES = -I/usr/include/ncursesw LIBCURS = ncursesw EXTRA_FLAGS += -DUNICODE_GLYPHS +ifneq ($(UNICODE_LOCALE),) +EXTRA_FLAGS += -DUNICODE_LOCALE=\"$(UNICODE_LOCALE)\" +endif + # The standard ncurses library also supports Unicode on Mac OS/Darwin. ifeq ($(shell uname),Darwin) LIBCURS = ncurses |