Before concatenating byte string (output from gettext) with unicode string (from XklWrapper), we have to encode the unicode string as utf-8.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/ui/gui/spokes/keyboard.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index 81d59e2..07548f5 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -363,7 +363,8 @@ class KeyboardSpoke(NormalSpoke): first_option = self.data.keyboard.switch_options[0] desc = self._xkl_wrapper.switch_to_show_str[first_option]
- self._layoutSwitchLabel.set_text(_(LAYOUT_SWITCHING_INFO) % desc) + self._layoutSwitchLabel.set_text(_(LAYOUT_SWITCHING_INFO) % \ + desc.encode("utf-8")) else: self._layoutSwitchLabel.set_text(_("Layout switching not " "configured."))
Before concatenating byte string (output from gettext) with unicode string (from XklWrapper), we have to encode the unicode string as utf-8.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
Looks good. I bet there will be more of this, too.
- Chris
On Thu, 2012-11-08 at 10:09 -0500, Chris Lumens wrote:
Before concatenating byte string (output from gettext) with unicode string (from XklWrapper), we have to encode the unicode string as utf-8.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
Looks good. I bet there will be more of this, too.
There shouldn't be any. But as I realized on today's lunch the problem lies beneath -- XklWrapper.switch_to_show_str is the only part of XklWrapper containing/returning unicode objects. I'm sending a new version of the patch.
We don't use unicode strings (as a type) in anaconda. XklWrapperr.switch_to_show_str should thus use encode("utf-8") and also contain byte strings.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com --- pyanaconda/keyboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py index c8024af..f317398 100755 --- a/pyanaconda/keyboard.py +++ b/pyanaconda/keyboard.py @@ -403,7 +403,7 @@ class XklWrapper(object): name = item_str(item.name)
self._switching_options.append(name) - self.switch_to_show_str[name] = desc + self.switch_to_show_str[name] = desc.encode("utf-8")
def get_available_layouts(self): """A generator yielding layouts (no need to store them as a bunch)"""
On Fri, Nov 09, 2012 at 01:14:59PM +0100, Vratislav Podzimek wrote:
We don't use unicode strings (as a type) in anaconda. XklWrapperr.switch_to_show_str should thus use encode("utf-8") and also contain byte strings.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
pyanaconda/keyboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Ack. I'll git-am this for tonight's build.
On Fri, Nov 09, 2012 at 03:58:51PM -0800, Brian C. Lane wrote:
On Fri, Nov 09, 2012 at 01:14:59PM +0100, Vratislav Podzimek wrote:
We don't use unicode strings (as a type) in anaconda. XklWrapperr.switch_to_show_str should thus use encode("utf-8") and also contain byte strings.
Signed-off-by: Vratislav Podzimek vpodzime@redhat.com
pyanaconda/keyboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Ack. I'll git-am this for tonight's build.
Darnit, I missed this one.
anaconda-patches@lists.fedorahosted.org