git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Gitweb error: XML Parsing Error: not well-formed

From
JMJuan J. Martinez <juan@memset.com>
Date
Feb 20, 2015, 15:17 UTC
Message-ID
<54E75023.7030701@memset.com>
Hi,

I'm experiencing a problem with gitweb and some utf-8 bits like £ (the pound sign) when showing diffs.

Example (Firefox's output):

XML Parsing Error: not well-formed Location: https://hostname/gitweb?p=redacted.git;a=commitdiff;h=16ae27d6b030949772b298c6e2935a09c48169a7 Line Number 913, Column 492:<div class="diff chunk_header"><span class="chunk_info">@@ <a class="list" href="/gitweb?p=redacted.git;a=blob;f=redacted/redacted.py;h=ce79b086288b96e6dd25d0f0bfb5b5018cca6fe0#l1043">-1043,7</a> <a class="list" href="/gitweb?p=redacted.git;a=blob;f=redacted/redacted.py;h=774c74b703a7d211fe19433236d1745ac7d7697c;hb=16ae27d6b030949772b298c6e2935a09c48169a7#l1044">+1044,7</a> @@</span><span class="section">&nbsp;outstanding&nbsp;amount&nbsp;is&nbsp;￿10.00.</span></div>

That should be "£10.00".

This is with latest gitweb code (sha:f3f407747c1cce420ae4b4857c4a6806efe38680) and perl v5.10.1.

The problem seems to be in gitweb.perl around line 1543.

Looks like utf8::is_utf8 returns false, and the conversion "in place" with utf8::decode doesn't seem to work (although it returns success, Firefox doesn't like it).

As a workaround I removed the "|| utf8::decode($str)" on the condition and the error is gone, although I'm not sure about the consequences of doing that (I guess it returns part of the content in the fallback encoding; latin1 in this case).

Regards,
Juan
-- 
Juan J. Martinez
Development Manager, MEMSET

mail: juan@memset.com
 web: http://www.memset.com/

Memset Ltd., registration number 4504980.
Building 87, Dunsfold Park, Stovolds Hill, Cranleigh, Surrey GU6 8TB, UK.
Message 1 of 1 in “Gitweb error: XML Parsing Error: not well-formed”
  1. Juan J. MartinezFeb 20, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.