{"thread":{"id":"38614","subject":"Gitweb error: XML Parsing Error: not well-formed","startedAt":"2015-02-20T15:17:55Z","lastAt":"2015-02-20T15:17:55Z","messageCount":1,"participants":["Juan J. Martinez"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"256420","messageId":"54E75023.7030701@memset.com","threadId":"38614","inReplyTo":null,"subject":"Gitweb error: XML Parsing Error: not well-formed","fromName":"Juan J. Martinez","fromEmail":"juan@memset.com","sentAt":"2015-02-20T15:17:55Z","receivedAt":"2015-02-20T15:17:55Z","isPatch":false,"sender":{"key":"juan@memset.com","avatar":null},"body":"Hi,\n\nI'm experiencing a problem with gitweb and some utf-8 bits like £ (the\npound sign) when showing diffs.\n\nExample (Firefox's output):\n\nXML Parsing Error: not well-formed Location:\nhttps://hostname/gitweb?p=redacted.git;a=commitdiff;h=16ae27d6b030949772b298c6e2935a09c48169a7\nLine Number 913, Column 492:<div class=\"diff chunk_header\"><span\nclass=\"chunk_info\">@@ <a class=\"list\"\nhref=\"/gitweb?p=redacted.git;a=blob;f=redacted/redacted.py;h=ce79b086288b96e6dd25d0f0bfb5b5018cca6fe0#l1043\">-1043,7</a>\n<a class=\"list\"\nhref=\"/gitweb?p=redacted.git;a=blob;f=redacted/redacted.py;h=774c74b703a7d211fe19433236d1745ac7d7697c;hb=16ae27d6b030949772b298c6e2935a09c48169a7#l1044\">+1044,7</a>\n@@</span><span\nclass=\"section\">&nbsp;outstanding&nbsp;amount&nbsp;is&nbsp;￿10.00.</span></div>\n\nThat should be \"£10.00\".\n\nThis is with latest gitweb  code\n(sha:f3f407747c1cce420ae4b4857c4a6806efe38680) and perl v5.10.1.\n\nThe problem seems to be in gitweb.perl around line 1543.\n\nLooks like utf8::is_utf8 returns false, and the conversion \"in place\"\nwith utf8::decode doesn't seem to work (although it returns success,\nFirefox doesn't like it).\n\nAs a workaround I removed the \"|| utf8::decode($str)\" on the condition\nand the error is gone, although I'm not sure about the consequences of\ndoing that (I guess it returns part of the content in the fallback\nencoding; latin1 in this case).\n\nRegards,\n\nJuan\n\n-- \nJuan J. Martinez\nDevelopment Manager, MEMSET\n\nmail: juan@memset.com\n web: http://www.memset.com/\n\nMemset Ltd., registration number 4504980.\nBuilding 87, Dunsfold Park, Stovolds Hill, Cranleigh, Surrey GU6 8TB, UK.\n"}]}