~ubuntu-branches/ubuntu/raring/irssi/raring

« back to all changes in this revision

Viewing changes to debian/patches/18bind_utf8-fix

  • Committer: Bazaar Package Importer
  • Author(s): أحمد المحمودي (Ahmed El-Mahmoudy)
  • Date: 2011-06-12 11:22:36 UTC
  • mfrom: (2.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20110612112236-slhqdmm2c0bd47zg
Tags: 0.8.15-4ubuntu1
* Merge from Debian unstable (LP: #796148), remaining changes:
  - debian/patches/03firsttimer_text:
    + Adapt it so it tells you about connecting to irc.ubuntu.com and
      joining #ubuntu instead of irc.debian.org and #debian.
  - debian/patches/90irc-ubuntu-com

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Author: kyak    vim:ft:diff:
 
1
Author: kyak    vim:ft=diff:
2
2
Description: fix for binding utf8 keys
3
3
Origin: other
4
4
Bug: http://bugs.irssi.org/index.php?do=details&task_id=553
5
5
 
 
6
Index: b/src/fe-common/core/keyboard.c
 
7
===================================================================
6
8
--- a/src/fe-common/core/keyboard.c
7
9
+++ b/src/fe-common/core/keyboard.c
8
 
@@ -569,8 +569,16 @@
 
10
@@ -569,8 +569,16 @@ int key_pressed(KEYBOARD_REC *keyboard,
9
11
        }
10
12
 
11
13
         first_key = keyboard->key_state == NULL;
14
16
+       /* fix for binding utf8 characters, done by kyak, upstream bug #553 */
15
17
+       if (keyboard->key_state == NULL) {
16
18
+               combo = g_strdup(key);
17
 
+       } else if (g_utf8_validate(key, 2, NULL)) {
 
19
+       } else if (key[1] != '\0' && key[1] != '[') {
18
20
+               char wchar[256];
19
21
+               g_snprintf(wchar, sizeof(wchar), "%c-%c", key[0], key[1]);
20
22
+               combo = g_strconcat(keyboard->key_state, "-", wchar, NULL);