All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Juan J. Martinez" <juan@memset.com>
To: git@vger.kernel.org
Subject: Gitweb error: XML Parsing Error: not well-formed
Date: Fri, 20 Feb 2015 15:17:55 +0000	[thread overview]
Message-ID: <54E75023.7030701@memset.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 1654 bytes --]

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.

                 reply	other threads:[~2015-02-20 15:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54E75023.7030701@memset.com \
    --to=juan@memset.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.