1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-23 06:35:36 +00:00

UTF-8 is now automatically used if locale is set properly.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2451 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-02-15 14:42:14 +00:00 committed by cras
parent d0a9710bb8
commit 9d1506ebca
2 changed files with 15 additions and 2 deletions

View File

@ -205,7 +205,7 @@ case "$host_os" in
esac
AC_CHECK_FUNCS(mkfifo fcntl)
AC_CHECK_FUNCS(mkfifo fcntl nl_langinfo)
AC_CHECK_FUNC(socket, [], [
AC_CHECK_LIB(socket, socket, [

View File

@ -26,6 +26,11 @@
#include "term.h"
#include "mainwindows.h"
#ifdef HAVE_NL_LANGINFO
# include <locale.h>
# include <langinfo.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
#endif
@ -100,7 +105,7 @@ static void read_settings(void)
/* set terminal type */
str = settings_get_str("term_type");
if (g_strcasecmp(str, "utf8") == 0)
if (g_strcasecmp(str, "utf-8") == 0)
term_type = TERM_TYPE_UTF8;
else if (g_strcasecmp(str, "big5") == 0)
term_type = TERM_TYPE_BIG5;
@ -137,6 +142,14 @@ void term_common_init(void)
term_use_colors = term_has_colors() && settings_get_bool("colors");
read_settings();
#ifdef HAVE_NL_LANGINFO
setlocale(LC_CTYPE, "");
if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0) {
term_type = TERM_TYPE_UTF8;
term_set_input_type(TERM_TYPE_UTF8);
}
#endif
signal_add("beep", (SIGNAL_FUNC) term_beep);
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
command_bind("resize", NULL, (SIGNAL_FUNC) cmd_resize);