[Rpm-metadata] createrepo/utils.py

James Antill jantill at redhat.com
Wed Apr 16 16:33:14 UTC 2008


On Wed, 2008-04-16 at 12:16 -0400, Luke Macken wrote:

> Ok, so it looks like we're losing here.
> 
> This utf8String method seems to be a bit misleading, and full of pain.  I assume we
> want to give it a utf-8 encoded string, and get back a unicode object, right?

 See my later patch, that is probably less mis-leading?

 In the caller, that we are having problems with, we want to give it a
str() from RPM (which may or may not be utf8) and get a valid utf8 str()
object back _that is also valid inside an XML document_ (excepting
random < > & bytes, which get converted).

 The big problem here being that a bunch of the "small bytes" like 0x01
are valid utf8 but aren't valid XML data. Hence the patches.

 After looking again, it's now obvious that we still screw up if we pass
a unicode() object in that has 0x01 bytes in it ... so we should
probably fix that too (although I'm not sure if that's possible).

-- 
James Antill <james.antill at redhat.com>
Red Hat



More information about the Rpm-metadata mailing list