1.1 --- a/examples/Common/Form/__init__.py Fri Sep 03 20:03:47 2004 +0000
1.2 +++ b/examples/Common/Form/__init__.py Fri Sep 03 20:04:13 2004 +0000
1.3 @@ -50,6 +50,9 @@
1.4 fields = trans.get_fields_from_body()
1.5
1.6 out = trans.get_response_stream()
1.7 +
1.8 + # Use Unicode for correct character encoding behaviour.
1.9 +
1.10 out.write(u"""
1.11 <html>
1.12 <head>
2.1 --- a/examples/Common/Simple/__init__.py Fri Sep 03 20:03:47 2004 +0000
2.2 +++ b/examples/Common/Simple/__init__.py Fri Sep 03 20:04:13 2004 +0000
2.3 @@ -9,7 +9,7 @@
2.4 "A simple resource."
2.5
2.6 def respond(self, trans):
2.7 - trans.set_content_type(WebStack.Generic.ContentType("text/html"))
2.8 + trans.set_content_type(WebStack.Generic.ContentType("text/html", "utf-8"))
2.9
2.10 # Get some information.
2.11
2.12 @@ -19,7 +19,10 @@
2.13 charset = trans.get_content_type().charset
2.14 else:
2.15 content_type, charset = None, None
2.16 - out.write("""
2.17 +
2.18 + # Use Unicode strings for correct character encoding.
2.19 +
2.20 + out.write(u"""
2.21 <html>
2.22 <head>
2.23 <title>Simple Example</title>