Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>

Index: new/server/inputs_channel.c
===================================================================
--- new.orig/server/inputs_channel.c	2013-10-21 07:32:57.000000000 +0200
+++ new/server/inputs_channel.c	2013-10-21 07:33:01.000000000 +0200
@@ -124,6 +124,11 @@
     }
     keyboard = _keyboard;
     keyboard->st = spice_new0(SpiceKbdState, 1);
+
+    SpiceKbdInterface *sif = SPICE_CONTAINEROF(keyboard->base.sif, SpiceKbdInterface, base);
+    if (sif && g_inputs_channel && sif->push_utf8) {
+        red_channel_set_cap(&g_inputs_channel->base, SPICE_INPUTS_CAP_KEY_UTF8);
+    }
     return 0;
 }
 
@@ -224,6 +229,20 @@
     sif->push_scan_freg(sin, scan);
 }
 
+static void kbd_push_utf8(SpiceKbdInstance *sin, uint32_t size, uint8_t *data)
+{
+    SpiceKbdInterface *sif;
+
+    if (!sin) {
+        return;
+    }
+    sif = SPICE_CONTAINEROF(sin->base.sif, SpiceKbdInterface, base);
+
+    if (sif->push_utf8) {
+        sif->push_utf8(sin, size, data);
+    }
+}
+
 static uint8_t kbd_get_leds(SpiceKbdInstance *sin)
 {
     SpiceKbdInterface *sif;
@@ -339,6 +358,10 @@
         }
         break;
     }
+    case SPICE_MSGC_INPUTS_KEY_UTF8: {
+        kbd_push_utf8(keyboard, size, (uint8_t *)buf);
+        break;
+    }
     case SPICE_MSGC_INPUTS_MOUSE_MOTION: {
         SpiceMsgcMouseMotion *mouse_motion = (SpiceMsgcMouseMotion *)buf;
 
Index: new/server/spice.h
===================================================================
--- new.orig/server/spice.h	2013-10-21 07:32:57.000000000 +0200
+++ new/server/spice.h	2013-10-23 09:39:10.000000000 +0200
@@ -262,7 +262,7 @@
 
 #define SPICE_INTERFACE_KEYBOARD "keyboard"
 #define SPICE_INTERFACE_KEYBOARD_MAJOR 1
-#define SPICE_INTERFACE_KEYBOARD_MINOR 1
+#define SPICE_INTERFACE_KEYBOARD_MINOR 2
 typedef struct SpiceKbdInterface SpiceKbdInterface;
 typedef struct SpiceKbdInstance SpiceKbdInstance;
 typedef struct SpiceKbdState SpiceKbdState;
@@ -272,6 +272,7 @@
 
     void (*push_scan_freg)(SpiceKbdInstance *sin, uint8_t frag);
     uint8_t (*get_leds)(SpiceKbdInstance *sin);
+    void (*push_utf8)(SpiceKbdInstance *sin, uint32_t size, uint8_t *data);
 };
 
 struct SpiceKbdInstance {

