]> skyeroc.xyz Git - dgamelaunch/commitdiff
Fix corruption of non-ASCII characters in banners.
authorPasi Kallinen <paxed@alt.org>
Mon, 3 Oct 2011 15:05:31 +0000 (15:05 +0000)
committerPasi Kallinen <paxed@alt.org>
Mon, 3 Oct 2011 15:05:31 +0000 (15:05 +0000)
    I hardcoded the locale to en_US.UTF-8 since it might get passed wrong,
    and it's a reasonable value on public servers.
    (Adam Borowski <kilobyte@angband.pl>)

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@596 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

configure.ac
dgamelaunch.c

index f26c5195926a1f78a8d2963c6011913cd0a070e8..499f653bed6fd1b198ce647411a1b37a4bd69ef2 100644 (file)
@@ -70,18 +70,18 @@ fi
 AC_SUBST(MKDEP)
 AC_SUBST(MKDEP_DIRECT)
 
-AC_SEARCH_LIBS(use_default_colors, [ncurses],
+AC_SEARCH_LIBS(use_default_colors, [ncursesw],
 [
-   AC_MSG_RESULT([Using ncurses and color.])
-   AC_DEFINE(USE_NCURSES_COLOR,1,[Use ncurses and color])
+   AC_MSG_RESULT([Using ncursesw and color.])
+   AC_DEFINE(USE_NCURSES_COLOR,1,[Use ncursesw and color])
 ],
 [
-   AC_MSG_RESULT([Not using ncurses, not using color.])
+   AC_MSG_RESULT([Not using ncursesw, not using color.])
 ])
 
 AC_PROG_INSTALL
-AC_SEARCH_LIBS(initscr, [ncurses curses], [], [
-   AC_MSG_ERROR([Cannot find curses or ncurses devel libs.])
+AC_SEARCH_LIBS(initscr, [ncursesw cursesw], [], [
+   AC_MSG_ERROR([Cannot find cursesw or ncursesw devel libs.])
 ])
 
 
index 905ac4127ac0af626c7fa17c8f8fc1480ab80c00..6fe064df697ac175a0976e53306cd23e1bc3e5c9 100644 (file)
@@ -60,6 +60,7 @@
 #include <libgen.h>
 #include <stdlib.h>
 #include <curses.h>
+#include <locale.h>
 
 #ifdef USE_SQLITE3
 # include <sqlite3.h>
@@ -2596,6 +2597,8 @@ main (int argc, char** argv)
        }
     }
 
+  setlocale(LC_CTYPE, "en_US.UTF-8");
+
   if (wall_email_str) {
       char *emailfrom = wall_email_str;
       char *emailmsg = strchr(wall_email_str, ':');