[Fedora-i18n-bugs] [Bug 668282] PackageKit yum backend uses incorrect encoding for dynamic category names, makes them show up with '?' characters in KPackageKit

bugzilla at redhat.com bugzilla at redhat.com
Fri Oct 21 07:15:48 UTC 2011


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=668282

--- Comment #31 from Zdeněk Pavlas <zpavlas at redhat.com> 2011-10-21 03:15:44 EDT ---
> it should be using to_utf8 instead, right?

Likely yes.  Python does not mix utf8 and unicode well.  Possible solutions
are:

a) Whenever some API returns python unicode object, convert it to utf8 and
pretend unicode does not exist.

b) Convert everything to unicode.  'yum' uses this.

to_utf8 and to_unicode are wrappers that skip conversion if already done.

c) sys.setdefaultencoding('utf-8')

Python then understands utf8 when implicitly converting strings to unicode, so 
'unicode + utf8' works as expected.  It's effectively b) but without the need
to call to_unicode explicitly.  It has issues too.
http://lists.baseurl.org/pipermail/yum-devel/2011-March/008034.html

If most of the code expects utf8, using a) is probably best.

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the i18n-bugs mailing list