changeset 27922:3b6f50b68f5d

Make gnt_keys_refine UTF8-compatible. Note, the rest of the tests don't need to be changed as multi-byte UTF8 values are always >128. Fixes #2504.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 16 Aug 2009 03:22:58 +0000
parents 027f342110b6
children df920ad8cf4f
files ChangeLog finch/libgnt/gntkeys.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Aug 15 19:59:14 2009 +0000
+++ b/ChangeLog	Sun Aug 16 03:22:58 2009 +0000
@@ -192,6 +192,8 @@
 	* The hardware cursor is updated correctly. This will be useful
 	  especially for users of braille terminals, screen readers etc.
 	* Added a TinyURL plugin, which aids copying longer URLs.
+	* Fixed UTF-8 compatibility problems which could cause exits or other
+	  unrequested behaviour.
 
 	Pidgin GTK+ Theme Control Plugin:
 	* Removed mouse cursor color preferences.
--- a/finch/libgnt/gntkeys.c	Sat Aug 15 19:59:14 2009 +0000
+++ b/finch/libgnt/gntkeys.c	Sun Aug 16 03:22:58 2009 +0000
@@ -166,7 +166,7 @@
 				strstr(term, "xterm") == term ||
 				strstr(term, "vt100") == term)
 			*(text + 1) = 'O';
-	} else if (*(unsigned char*)text == 195) {
+	} else if (g_utf8_get_char(text) == 195) {
 		if (*(text + 2) == 0 && strstr(term, "xterm") == term) {
 			*(text) = 27;
 			*(text + 1) -= 64;  /* Say wha? */