[issue6852] Unicode IO not working in cgi applet

loveminix report at bugs.python.org
Mon Sep 7 06:32:21 CEST 2009


New submission from loveminix <loveminix at yahoo.com.cn>:

The following cgi applet does output Unicode string correctly in an
Ubuntu terminal, but when invoked from a web browser (IE or Firefox) by
a client, it doesn't output the Unicode string. Output stops at
"...<div><p>", right before the Unicode string "中文".

#! /usr/bin/python3
# -*- coding: utf-8 -*-

print(
"""\
Content-type: text/html
"""
);

print(
"""\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
</head>
<body>\
"""
);

print("<div><p>");
print("中文");
print("</p></div>");

print(
"""\
</body>
</html>\
"""
);

----------
components: Unicode
messages: 92341
nosy: loveminix
severity: normal
status: open
title: Unicode IO not working in cgi applet
type: behavior
versions: Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6852>
_______________________________________


More information about the Python-bugs-list mailing list