• Andrés G. Aragoneses's avatar
    Revert "Migo: Fixed parsing RSSs with BOM (bgo#727432)" · 1bb41479
    Andrés G. Aragoneses authored
    This reverts commit 27f1135e.
    There were some problems with this patch:
    a) When improving the version that Marcin posted in bugzilla,
    in order to not hardcode UTF8 encoding, I incorrectly placed
    this logic inside an if block like this:
     if (s.StartsWith("<?xml")) {
    Given that the logic to remove the bom also asks for
     if (s.StartsWith(bom)) {
    You would think that the logic added to fix this bug
    would simply not work (because the condition that made
    the code flow enter into the parent block would make
    the second condition FALSE).
    However, surprisingly enough, the bom from the podcast
    example in bugzilla [0] is parsed as UTF8 and UTF8's
    ByteOrderMark's length is 1, and Mono returns true for
    both of the conditions above, even if bom is obviously
    not "<" (the first character of the "<?xml" string to
    check if the content is XML.
    I still don't understand how can this be possible, but
    the consequence of it is that the content is stripped
    from its first character, so all XML feeds received
    that started with "<?xml" were converted to a string
    starting with "?xml", which clearly resulted in a
    parsing error.
    Not sure if this is a Mono bug, and not sure this is
    fixed in newer versions, but with the version I'm using
    now (3.2.8) I cannot reproduce bug 727432, and this is
    a very widely used version of Mono (it comes with
    Ubuntu 14.04 LTS, 14.10, and 15.04). So I'm reverting
    the fix for this (until we figure out a better fix, and
    the exact environment to reproduce it), otherwise many
    more podcasts would be broken.
    [0] http://podcast.dr.dk/p1/rssfeed/orientering.xml
Last commit
Last update
Backends Loading commit data...
Clients Loading commit data...
Core Loading commit data...
Dap Loading commit data...
Extensions Loading commit data...
Hyena @ 229d3e81 Loading commit data...
Libraries Loading commit data...
AssemblyInfo.cs.in Loading commit data...
Makefile.am Loading commit data...
create-extension Loading commit data...
generate-dbus-docs Loading commit data...
nuke-core-tables Loading commit data...
nuke-dev-keys Loading commit data...
nuke-gconf-keys Loading commit data...
run-banshee Loading commit data...