[Zope3-checkins] SVN: Zope3/trunk/src/zwiki/browser/ Fixed issue 395: zwiki utf-8 problem

Dmitry Vasiliev dima at hlabs.spb.ru
Fri Apr 15 03:57:09 EDT 2005


Log message for revision 29995:
  Fixed issue 395: zwiki utf-8 problem
  

Changed:
  A   Zope3/trunk/src/zwiki/browser/browser.txt
  A   Zope3/trunk/src/zwiki/browser/ftests.py
  U   Zope3/trunk/src/zwiki/browser/wikipage.py

-=-
Added: Zope3/trunk/src/zwiki/browser/browser.txt
===================================================================
--- Zope3/trunk/src/zwiki/browser/browser.txt	2005-04-15 07:44:36 UTC (rev 29994)
+++ Zope3/trunk/src/zwiki/browser/browser.txt	2005-04-15 07:57:08 UTC (rev 29995)
@@ -0,0 +1,56 @@
+==========
+Wiki Views
+==========
+
+ViewWikiPage
+------------
+
+Let's start by creating a wiki:
+
+  >>> print http(r"""
+  ... POST /+/AddWiki.html%3D HTTP/1.1
+  ... Authorization: Basic mgr:mgrpw
+  ... Content-Type: application/x-www-form-urlencoded
+  ... 
+  ... frontpage%3Aint=1&UPDATE_SUBMIT=Add&add_input_name=wiki""")
+  HTTP/1.1 303 See Other
+  ...
+
+Then add some cyrillic (utf-8) text for FrontPage:
+
+  >>> print http(r"""
+  ... POST /wiki/FrontPage/@@edit.html HTTP/1.1
+  ... Authorization: Basic mgr:mgrpw
+  ... Content-Type: multipart/form-data; boundary=---------------------------177450441711245361571701954867
+  ... 
+  ... -----------------------------177450441711245361571701954867
+  ... Content-Disposition: form-data; name="field.source"
+  ... 
+  ... Cyrillic text: Тест
+  ... -----------------------------177450441711245361571701954867
+  ... Content-Disposition: form-data; name="field.type"
+  ... 
+  ... zope.source.plaintext
+  ... -----------------------------177450441711245361571701954867
+  ... Content-Disposition: form-data; name="field.type-empty-marker"
+  ... 
+  ... 1
+  ... -----------------------------177450441711245361571701954867
+  ... Content-Disposition: form-data; name="UPDATE_SUBMIT"
+  ... 
+  ... Change
+  ... -----------------------------177450441711245361571701954867--
+  ... """)
+  HTTP/1.1 303 See Other
+  ...
+
+Now we can check the result:
+
+  >>> print http(r"""
+  ... GET /wiki/FrontPage/@@view.html HTTP/1.1
+  ... Authorization: Basic mgr:mgrpw
+  ... """)
+  HTTP/1.1 200 Ok
+  ...
+        Cyrillic text: Тест
+  ...

Added: Zope3/trunk/src/zwiki/browser/ftests.py
===================================================================
--- Zope3/trunk/src/zwiki/browser/ftests.py	2005-04-15 07:44:36 UTC (rev 29994)
+++ Zope3/trunk/src/zwiki/browser/ftests.py	2005-04-15 07:57:08 UTC (rev 29995)
@@ -0,0 +1,23 @@
+##############################################################################
+#
+# Copyright (c) 2003 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""Functional tests.
+
+$Id$
+"""
+
+from zope.app.testing.functional import FunctionalDocFileSuite
+
+
+def test_suite():
+    return FunctionalDocFileSuite("browser.txt")


Property changes on: Zope3/trunk/src/zwiki/browser/ftests.py
___________________________________________________________________
Name: svn:keywords
   + Id

Modified: Zope3/trunk/src/zwiki/browser/wikipage.py
===================================================================
--- Zope3/trunk/src/zwiki/browser/wikipage.py	2005-04-15 07:44:36 UTC (rev 29994)
+++ Zope3/trunk/src/zwiki/browser/wikipage.py	2005-04-15 07:57:08 UTC (rev 29995)
@@ -114,10 +114,8 @@
 class ViewWikiPage:
     """A rendered View of the wiki page."""
 
-    def renderWikiLinks(self, source):
+    def renderWikiLinks(self, html):
         """Add Wiki Links to the source"""
-
-        html = str(source)
         html = re.sub(protectedLine, self._protectLine, html)
         html = re.sub(interwikilink, self._interwikilinkReplace, html)
         html = re.sub(wikilink, self._wikilinkReplace, html)



More information about the Zope3-Checkins mailing list