forked from PsychoticNinja/irssi
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:
parent
d0a9710bb8
commit
9d1506ebca
@ -205,7 +205,7 @@ case "$host_os" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
AC_CHECK_FUNCS(mkfifo fcntl)
|
AC_CHECK_FUNCS(mkfifo fcntl nl_langinfo)
|
||||||
|
|
||||||
AC_CHECK_FUNC(socket, [], [
|
AC_CHECK_FUNC(socket, [], [
|
||||||
AC_CHECK_LIB(socket, socket, [
|
AC_CHECK_LIB(socket, socket, [
|
||||||
|
@ -26,6 +26,11 @@
|
|||||||
#include "term.h"
|
#include "term.h"
|
||||||
#include "mainwindows.h"
|
#include "mainwindows.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_NL_LANGINFO
|
||||||
|
# include <locale.h>
|
||||||
|
# include <langinfo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_IOCTL_H
|
#ifdef HAVE_SYS_IOCTL_H
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
@ -100,7 +105,7 @@ static void read_settings(void)
|
|||||||
|
|
||||||
/* set terminal type */
|
/* set terminal type */
|
||||||
str = settings_get_str("term_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;
|
term_type = TERM_TYPE_UTF8;
|
||||||
else if (g_strcasecmp(str, "big5") == 0)
|
else if (g_strcasecmp(str, "big5") == 0)
|
||||||
term_type = TERM_TYPE_BIG5;
|
term_type = TERM_TYPE_BIG5;
|
||||||
@ -137,6 +142,14 @@ void term_common_init(void)
|
|||||||
term_use_colors = term_has_colors() && settings_get_bool("colors");
|
term_use_colors = term_has_colors() && settings_get_bool("colors");
|
||||||
read_settings();
|
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("beep", (SIGNAL_FUNC) term_beep);
|
||||||
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
signal_add("setup changed", (SIGNAL_FUNC) read_settings);
|
||||||
command_bind("resize", NULL, (SIGNAL_FUNC) cmd_resize);
|
command_bind("resize", NULL, (SIGNAL_FUNC) cmd_resize);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user