[Zope-Checkins] CVS: Zope/lib/python/App/dtml - manage_page_header.dtml:1.11.32.1.2.1

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 27 Jan 2003 11:22:30 -0500


Update of /cvs-repository/Zope/lib/python/App/dtml
In directory cvs.zope.org:/tmp/cvs-serv22232/lib/python/App/dtml

Modified Files:
      Tag: toby-charset-branch
	manage_page_header.dtml 
Log Message:
collector 737 - Fixed bug that caused problems for non-latin1 users who are not using unicode

=== Zope/lib/python/App/dtml/manage_page_header.dtml 1.11.32.1 => 1.11.32.1.2.1 ===
--- Zope/lib/python/App/dtml/manage_page_header.dtml:1.11.32.1	Sun Dec 22 11:16:14 2002
+++ Zope/lib/python/App/dtml/manage_page_header.dtml	Mon Jan 27 11:21:57 2003
@@ -1,11 +1,29 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
 <html>
 <head>
-<dtml-unless management_page_charset>
-<dtml-call "REQUEST.set('management_page_charset','iso-8859-1')">
-</dtml-unless>
-<meta http-equiv="content-type" content="text/html;charset=<dtml-var management_page_charset>">
-<dtml-call "RESPONSE.setHeader('content-type','text/html;charset='+management_page_charset)">
+
+<dtml-if "REQUEST.get('management_page_charset')">
+    <dtml-comment>
+    A page-specific encoding specification. Good.
+    </dtml-comment>
+<dtml-elif management_page_charset>
+    <dtml-comment>
+    A site-global encoding specification in a property.
+    Note that this feature only works if there are no unicode objects
+    around. This means that this feature is not likely to be supported
+    in all future versions of zope.
+    </dtml-comment>
+    <dtml-call "REQUEST.set('management_page_charset',_['management_page_charset'])">
+<dtml-else>
+    <dtml-comment>
+    No encoding specification. Most pages are like this.
+    </dtml-comment>
+    <dtml-call "REQUEST.set('management_page_charset','iso-8859-1')">
+</dtml-if>
+
+<meta http-equiv="content-type" content="text/html;charset=<dtml-var "REQUEST['management_page_charset']">">
+<dtml-call "RESPONSE.setHeader('content-type','text/html;charset='+REQUEST['management_page_charset'])">
+
 <title><dtml-if title>&dtml-title;</dtml-if></title>
 <dtml-let ag="REQUEST.get('HTTP_USER_AGENT', '')"
      is_nav4="ag[:9] == 'Mozilla/4' and _.string.find(ag, 'MSIE') < 0"