# HG changeset patch # User OHASHI Hideya # Date 2007-06-13 09:18:06 # Node ID ecea4de3104ee944520492922c0051124fe69128 # Parent 54a2b94a372c6a5bf76ce70256a5061a377e8e03 Enable to select encoding in hgrc web section This patch provides character encoding setting in each repository. After this patch, You can use multi encoding repositories with one mercurial server. diff --git a/doc/hgrc.5.txt b/doc/hgrc.5.txt --- a/doc/hgrc.5.txt +++ b/doc/hgrc.5.txt @@ -551,6 +551,9 @@ web:: Which template map style to use. templates;; Where to find the HTML templates. Default is install path. + encoding;; + Character encoding name. + Example: "UTF-8" AUTHOR diff --git a/mercurial/hgweb/hgweb_mod.py b/mercurial/hgweb/hgweb_mod.py --- a/mercurial/hgweb/hgweb_mod.py +++ b/mercurial/hgweb/hgweb_mod.py @@ -103,6 +103,7 @@ class hgweb(object): self.maxshortchanges = int(self.config("web", "maxshortchanges", 60)) self.maxfiles = int(self.config("web", "maxfiles", 10)) self.allowpull = self.configbool("web", "allowpull", True) + self.encoding = self.config("web", "encoding", util._encoding) def archivelist(self, nodeid): allowed = self.configlist("web", "allow_archive") @@ -655,7 +656,7 @@ class hgweb(object): def run_wsgi(self, req): def header(**map): header_file = cStringIO.StringIO( - ''.join(self.t("header", encoding=util._encoding, **map))) + ''.join(self.t("header", encoding=self.encoding, **map))) msg = mimetools.Message(header_file, 0) req.header(msg.items()) yield header_file.read()