diff mcabber/src/screen.c @ 932:fc6aaa223650

Fix a few problems with non-UTF-8 locales
author Mikael Berthe <mikael@lilotux.net>
date Sat, 08 Jul 2006 09:43:18 +0200
parents 1cd6d694ac3c
children ede9260be93d
line wrap: on
line diff
--- a/mcabber/src/screen.c	Sat Jul 08 09:43:01 2006 +0200
+++ b/mcabber/src/screen.c	Sat Jul 08 09:43:18 2006 +0200
@@ -2221,15 +2221,15 @@
   }
   // Right side
   if (direction >= 0) {
-    int delta = wcwidth(get_char(c));
+    int delta = get_char_width(c);
     while (ptr_inputline > c) {
       c = next_char(c);
-      delta += wcwidth(get_char(c));
+      delta += get_char_width(c);
     }
     c = &inputLine[inputline_offset];
     while (delta >= maxX) {
       for (i = 0; i < 5; i++) {
-        delta -= wcwidth(get_char(c));
+        delta -= get_char_width(c);
         c = next_char(c);
       }
     }
@@ -2652,7 +2652,7 @@
 
 display:
   if (display_char) {
-    if (iswprint(key) && (!utf8_mode || kcode.utf8 || key < 128)) {
+    if (kcode.utf8 ? iswprint(key) : isprint(key)) {
       char tmpLine[INPUTLINE_LENGTH+1];
 
       // Check the line isn't too long