[PATCH] highlight: pass hgweb.encoding to lexers and formatter

Christian Ebert blacktrash at gmx.net
Tue Dec 11 16:43:46 CST 2007

* Matt Mackall on Tuesday, December 11, 2007 at 15:50:00 -0600
> On Tue, Dec 11, 2007 at 10:21:23PM +0100, Christian Ebert wrote:
>> The following is needed to avoid a nasty backtrace when a file
>> contains non-ascii characters.


> Ugh. Apps should assume that regardless of what encoding they're in,
> someone's going to throw them a byte that can't be decoded. If it was
> throwing an exception when it was assuming ASCII, it will still throw
> exceptions when you try to pass off Latin-1 as UTF-8 or whatever.

Well, I *did* test with a file in latin-1 and HGENCODING=UTF-8
and the result is the same as with highlight turned off, and no

keyword extension for Mercurial (http://selenic.com/mercurial):
<http://www.blacktrash.org/hg/hgkeyword/> (incl. 0.9.2 compatible branch)
Mercurial crew development repository + keyword extension:

More information about the Mercurial-devel mailing list