# HG changeset patch # User paulb # Date 1094241853 0 # Node ID 2c757dbd48710db7e1ae64aeeabb492aa6143d27 # Parent 88245d14e139c903d0f3e09a13887ae4e4d19471 [project @ 2004-09-03 20:04:11 by paulb] Adopted Unicode in the template to ensure correct encoding. diff -r 88245d14e139 -r 2c757dbd4871 examples/Common/Form/__init__.py --- a/examples/Common/Form/__init__.py Fri Sep 03 20:03:47 2004 +0000 +++ b/examples/Common/Form/__init__.py Fri Sep 03 20:04:13 2004 +0000 @@ -50,6 +50,9 @@ fields = trans.get_fields_from_body() out = trans.get_response_stream() + + # Use Unicode for correct character encoding behaviour. + out.write(u""" diff -r 88245d14e139 -r 2c757dbd4871 examples/Common/Simple/__init__.py --- a/examples/Common/Simple/__init__.py Fri Sep 03 20:03:47 2004 +0000 +++ b/examples/Common/Simple/__init__.py Fri Sep 03 20:04:13 2004 +0000 @@ -9,7 +9,7 @@ "A simple resource." def respond(self, trans): - trans.set_content_type(WebStack.Generic.ContentType("text/html")) + trans.set_content_type(WebStack.Generic.ContentType("text/html", "utf-8")) # Get some information. @@ -19,7 +19,10 @@ charset = trans.get_content_type().charset else: content_type, charset = None, None - out.write(""" + + # Use Unicode strings for correct character encoding. + + out.write(u""" Simple Example