[PATCH] hgweb: fix encoding issue in commit log

Hideya 'OhaC' OHASHI ohachige at gmail.com
Sun Feb 17 21:49:51 CST 2008


2008/2/18, Thomas Arendsen Hein <thomas at intevation.de>:
> * OHASHI Hideya <ohachige at gmail.com> [20070829 18:25]:
> > # HG changeset patch
> > # User OHASHI Hideya <ohachige at gmail.com>
> > # Date 1188398770 -32400
> > # Node ID 9f99d5a65b1f544897db9f744a900b336473cc63
> > # Parent  15a108ad7adb0be221234177e544bdf196848309
> > hgweb: fix encoding issue in commit log
> >
> > diff -r 15a108ad7adb -r 9f99d5a65b1f mercurial/hgweb/hgweb_mod.py
> > --- a/mercurial/hgweb/hgweb_mod.py    Tue Aug 28 23:02:41 2007 -0300
> > +++ b/mercurial/hgweb/hgweb_mod.py    Wed Aug 29 23:46:10 2007 +0900
> > @@ -104,6 +104,7 @@ class hgweb(object):
> >              self.maxfiles = int(self.config("web", "maxfiles", 10))
> >              self.allowpull = self.configbool("web", "allowpull", True)
> >              self.encoding = self.config("web", "encoding", util._encoding)
> > +            util._encoding = self.encoding
> >
> >      def archivelist(self, nodeid):
> >          allowed = self.configlist("web", "allow_archive")
>
> This hasn't been applied yet. What is the problem that is fixed by
> this?

Here is a simple example to reproduce the problem.

$ hg init hgtest
$ cd hgtest
$ echo 'a' >a
$ hg addremove
$ hg ci -m 'あ' # UTF-8 string
$ cat >.hg/hgrc
[web]
encoding = EUC-JP
^D
$ hg serve &
$ wget --save-headers -O out http://localhost:8000/
$ grep charset out
Content-Type: text/html; charset=EUC-JP
$ nkf -g out # guessing what is this encoding
UTF-8


More information about the Mercurial-devel mailing list