diff --git a/gi/overrides/Gtk.py b/gi/overrides/Gtk.py
index 78bbd36..3fea7d6 100644
--- a/gi/overrides/Gtk.py
+++ b/gi/overrides/Gtk.py
@@ -294,7 +294,7 @@ class UIManager(Gtk.UIManager):
         if not isinstance(buffer, _basestring):
             raise TypeError('buffer must be a string')
 
-        length = len(buffer)
+        length = len(buffer.encode('utf-8'))
 
         return Gtk.UIManager.add_ui_from_string(self, buffer, length)
 
