Mercurial > p > roundup > code
comparison roundup/cgi/client.py @ 2947:e611be5ee6c4
initialize self.charset early to enable html output for tracebacks...
...occurring before determine_charset() call.
| author | Alexander Smishlajev <a1s@users.sourceforge.net> |
|---|---|
| date | Mon, 22 Nov 2004 10:46:18 +0000 |
| parents | 661028d24cd2 |
| children | deda13909085 |
comparison
equal
deleted
inserted
replaced
| 2946:661028d24cd2 | 2947:e611be5ee6c4 |
|---|---|
| 1 # $Id: client.py,v 1.207 2004-11-22 09:12:02 a1s Exp $ | 1 # $Id: client.py,v 1.208 2004-11-22 10:46:18 a1s Exp $ |
| 2 | 2 |
| 3 """WWW request handler (also used in the stand-alone server). | 3 """WWW request handler (also used in the stand-alone server). |
| 4 """ | 4 """ |
| 5 __docformat__ = 'restructuredtext' | 5 __docformat__ = 'restructuredtext' |
| 6 | 6 |
| 147 | 147 |
| 148 # additional headers to send with the request - must be registered | 148 # additional headers to send with the request - must be registered |
| 149 # before the first write | 149 # before the first write |
| 150 self.additional_headers = {} | 150 self.additional_headers = {} |
| 151 self.response_code = 200 | 151 self.response_code = 200 |
| 152 | |
| 153 # default character set | |
| 154 self.charset = self.STORAGE_CHARSET | |
| 152 | 155 |
| 153 # parse cookies (used in charset and session lookups) | 156 # parse cookies (used in charset and session lookups) |
| 154 self.cookie = Cookie.SimpleCookie(self.env.get('HTTP_COOKIE', '')) | 157 self.cookie = Cookie.SimpleCookie(self.env.get('HTTP_COOKIE', '')) |
| 155 | 158 |
| 156 self.user = None | 159 self.user = None |
| 313 If no charset requested by client, use storage charset (utf-8). | 316 If no charset requested by client, use storage charset (utf-8). |
| 314 | 317 |
| 315 If the charset is found, and differs from the storage charset, | 318 If the charset is found, and differs from the storage charset, |
| 316 recode all form fields of type 'text/plain' | 319 recode all form fields of type 'text/plain' |
| 317 """ | 320 """ |
| 318 # default to storage charset | |
| 319 self.charset = self.STORAGE_CHARSET | |
| 320 | 321 |
| 321 # look for client charset | 322 # look for client charset |
| 322 charset_parameter = 0 | 323 charset_parameter = 0 |
| 323 if self.form.has_key('@charset'): | 324 if self.form.has_key('@charset'): |
| 324 charset = self.form['@charset'].value | 325 charset = self.form['@charset'].value |
