[Yum-devel] [PATCH] clean up misc.to_xml(), make it faster, add tests. BZ 716235.

Ville Skyttä ville.skytta at iki.fi
Sat Nov 17 09:02:14 UTC 2012


On 2012-11-16 15:47, Zdeněk Pavlas wrote:
> Returns valid UTF8

Valid UTF-8 maybe, but also infested with ugly replacement characters
when for example to_xml()'ing stuff extracted from packages built from
specfiles in iso-8859-1.

Using my surname encoded in iso-8859-1 as an example, with original
_ugly_utf8_string_hack in place (ignoring the unnecessary "iso-8859-1
encoding on ..." output which could be removed):

    $ python -c "import yum.misc; print yum.misc.to_xml('Skytt\xe4')"
    Skyttä

After this patch:

    $ python -c "import yum.misc; print yum.misc.to_xml('Skytt\xe4')"
    Skytt�

That'd be a regression in my opinion.


More information about the Yum-devel mailing list