Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
baf8ead2
Commit
baf8ead2
authored
Jul 26, 2007
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged r78365 from 2.10 branch.
parent
ff82d86a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
doc/CHANGES.txt
doc/CHANGES.txt
+3
-0
lib/python/Products/PageTemplates/ZopePageTemplate.py
lib/python/Products/PageTemplates/ZopePageTemplate.py
+4
-5
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
...thon/Products/PageTemplates/tests/testZopePageTemplate.py
+7
-0
No files found.
doc/CHANGES.txt
View file @
baf8ead2
...
...
@@ -132,6 +132,9 @@ Zope Changes
Bugs Fixed
- ZopePageTemplate's pt_edit did not recognize content type arguments
which had a charset information included.
- "version.txt" file was being written to the wrong place by the
Makefile, causing Zope to report "unreleased version" even for
released versions.
...
...
lib/python/Products/PageTemplates/ZopePageTemplate.py
View file @
baf8ead2
...
...
@@ -126,7 +126,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
encoding
=
None
output_encoding
=
None
if
content_type
in
(
'text/xml'
,
):
if
content_type
.
startswith
(
'text/xml'
):
if
is_unicode
:
encoding
=
None
...
...
@@ -135,8 +135,7 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
encoding
=
encodingFromXMLPreamble
(
text
)
output_encoding
=
'utf-8'
elif
content_type
in
(
'text/html'
,)
:
elif
content_type
.
startswith
(
'text/html'
):
charset
=
charsetFromMetaEquiv
(
text
)
...
...
lib/python/Products/PageTemplates/tests/testZopePageTemplate.py
View file @
baf8ead2
...
...
@@ -165,6 +165,13 @@ class ZopePageTemplateFileTests(ZopeTestCase):
self
.
assertEqual
(
zpt
.
read
(),
s
)
self
.
assertEqual
(
isinstance
(
zpt
.
read
(),
unicode
),
True
)
def
testEditWithContentTypeCharset
(
self
):
manage_addPageTemplate
(
self
.
app
,
'test'
,
xml_utf8
,
encoding
=
'utf-8'
)
zpt
=
self
.
app
[
'test'
]
xml_unicode
=
unicode
(
xml_utf8
,
'utf-8'
).
strip
()
zpt
.
pt_edit
(
xml_unicode
,
'text/xml'
)
zpt
.
pt_edit
(
xml_unicode
,
'text/xml; charset=utf-8'
)
self
.
assertEqual
(
zpt
.
read
(),
xml_unicode
)
def
_createZPT
(
self
):
manage_addPageTemplate
(
self
.
app
,
'test'
,
text
=
utf8_str
,
encoding
=
'utf-8'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment