##// END OF EJS Templates
hgweb: report detected character set...
Matt Mackall -
r3781:713e35dc default
parent child Browse files
Show More
@@ -10,6 +10,13 b' from mercurial.hgweb.hgweb_mod import hg'
10 10 from mercurial.hgweb.request import wsgiapplication
11 11 import mercurial.hgweb.wsgicgi as wsgicgi
12 12
13 # If you'd like to serve pages with UTF-8 instead of your default
14 # locale charset, you can do so by uncommenting the following lines.
15 # Note that this will cause your .hgrc files to be interpreted in
16 # UTF-8 and all your repo files to be displayed using UTF-8.
17 #
18 # os.environ["HGENCODING"] = "UTF-8"
19
13 20 def make_web_app():
14 21 return hgweb("/path/to/repo", "repository name")
15 22
@@ -29,6 +29,13 b' import mercurial.hgweb.wsgicgi as wsgicg'
29 29 # Alternatively you can pass a list of ('virtual/path', '/real/path') tuples
30 30 # or use a dictionary with entries like 'virtual/path': '/real/path'
31 31
32 # If you'd like to serve pages with UTF-8 instead of your default
33 # locale charset, you can do so by uncommenting the following lines.
34 # Note that this will cause your .hgrc files to be interpreted in
35 # UTF-8 and all your repo files to be displayed using UTF-8.
36 #
37 # os.environ["HGENCODING"] = "UTF-8"
38
32 39 def make_web_app():
33 40 return hgwebdir("hgweb.config")
34 41
@@ -654,7 +654,8 b' class hgweb(object):'
654 654
655 655 def run_wsgi(self, req):
656 656 def header(**map):
657 header_file = cStringIO.StringIO(''.join(self.t("header", **map)))
657 header_file = cStringIO.StringIO(
658 ''.join(self.t("header", encoding = util._encoding, **map)))
658 659 msg = mimetools.Message(header_file, 0)
659 660 req.header(msg.items())
660 661 yield header_file.read()
@@ -1,11 +1,10 b''
1 Content-type: text/html
1 Content-type: text/html; charset={encoding}
2 2
3 <?xml version="1.0" encoding="utf-8"?>
3 <?xml version="1.0" encoding="{encoding}"?>
4 4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
6 6 <head>
7 7 <link rel="icon" href="{url}static/hgicon.png" type="image/png">
8 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
9 8 <meta name="robots" content="index, nofollow"/>
10 9 <link rel="stylesheet" href="{url}static/style-gitweb.css" type="text/css" />
11 10
@@ -1,4 +1,4 b''
1 Content-type: text/html
1 Content-type: text/html; charset={encoding}
2 2
3 3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 4 <html>
@@ -1,1 +1,2 b''
1 Content-type: text/plain
1 Content-type: text/plain; charset={encoding}
2
General Comments 0
You need to be logged in to leave comments. Login now