From 70fd9c005bf9c037c13250e49f69b7df03f93afe Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 3 Oct 2011 15:05:31 +0000 Subject: [PATCH] Fix corruption of non-ASCII characters in banners. 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 ) git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@596 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- configure.ac | 12 ++++++------ dgamelaunch.c | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index f26c519..499f653 100644 --- a/configure.ac +++ b/configure.ac @@ -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.]) ]) diff --git a/dgamelaunch.c b/dgamelaunch.c index 905ac41..6fe064d 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -60,6 +60,7 @@ #include #include #include +#include #ifdef USE_SQLITE3 # include @@ -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, ':');