From 4ea54d259d9a48df3c10c885e45b31d7da6aa35a Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Sat, 7 Dec 2002 16:21:54 +0000 Subject: Document.Format(): Include a META tag with the content-type information. I found that with Mozilla 1.2.1, the only way to be sure to get the admin pages in the right charset was to include both the Content-Type: http header and this META tag. --- Mailman/htmlformat.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Mailman/htmlformat.py') diff --git a/Mailman/htmlformat.py b/Mailman/htmlformat.py index 4e9a1e6b2..0175bccb8 100644 --- a/Mailman/htmlformat.py +++ b/Mailman/htmlformat.py @@ -289,12 +289,6 @@ class Document(Container): def set_language(self, lang=None): self.language = lang - def get_content_type(self): - ctype = 'Content-type: text/html' - if self.language: - ctype += '; charset=' + Utils.GetCharSet(self.language) - return ctype + '\n' - def set_bgcolor(self, color): self.bgcolor = color @@ -302,7 +296,10 @@ class Document(Container): self.title = title def Format(self, indent=0, **kws): - output = [self.get_content_type()] + charset = 'us-ascii' + if self.language: + charset = Utils.GetCharSet(self.language) + output = ['Content-Type: text/html; charset=%s\n' % charset] if not self.suppress_head: kws.setdefault('bgcolor', self.bgcolor) tab = ' ' * indent @@ -313,6 +310,9 @@ class Document(Container): if mm_cfg.IMAGE_LOGOS: output.append('' % (mm_cfg.IMAGE_LOGOS + mm_cfg.SHORTCUT_ICON)) + # Hit all the bases + output.append('' % charset) if self.title: output.append('%s