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

Matt Mackall mpm at selenic.com
Tue Dec 11 17:08:37 CST 2007

On Tue, Dec 11, 2007 at 11:43:46PM +0100, Christian Ebert wrote:
> * 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
> backtrace.

Maybe I didn't look at your original patch closely enough, do you fall
back to non-highlighted output?

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial-devel mailing list