xml style doesn't generate valid xml

Kevin Bullock kbullock+mercurial at ringworld.org
Tue Nov 23 17:40:29 UTC 2010


On Nov 23, 2010, at 11:15 AM, Paul Boddie wrote:

> Haszlakiewicz, Eric wrote:
>> Oh, commit messages have to be in UTF-8?  I didn't realize that.
> 
> What impact does this have on hgweb? I see that there's an {encoding} variable which presumably gets set to the "natural" encoding of the repository, but this would mean that commit messages have to be transcoded to that encoding which might not be possible in some cases, although it's fairly likely that if one is working with that encoding, one has probably written commit messages in that encoding, and so the messages will be representable in that encoding. (One should never underestimate the power of tools like text editors to do the wrong thing at a specific moment, however.)
> 
> With all that said, if a repository originates in a non-Unicode environment, restricting the Web interface to that specific environment's encoding is a bit unfortunate if one wants to use things like symbols, non-ASCII characters and so on in the templates.

Well, as Eric mentioned, for HTML or XML output, you can always fall back on character entities to encode non-ASCII. Browsers generally have no problem with alternate encodings provided you declare it properly (in both the Content-Type header, and for HTML, the <meta http-equiv="Content-Type" ...> tag, if present, or for XML, in the <?xml ...?> declaration).

> Paul

pacem in terris / mir / shanti / salaam / heiwa
Kevin R. Bullock




More information about the Mercurial mailing list