[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-09 Thread Christian Heimes
Christian Heimes added the comment: PS: http://www.joelonsoftware.com/articles/Unicode.html is a nice article about unicode and character sets. Joel is amazing when it comes to explaining complex problems in simple words. __ Tracker <[EMAIL PROTECTED]>

[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-09 Thread Christian Heimes
Christian Heimes added the comment: Yes, it's possible to send UTF-8 data: >>> data = u"testdata umlaut öäü".encode("utf-8") >>> data 'testdata umlaut \xc3\xb6\xc3\xa4\xc3\xbc' >>> type(data) >>> data == str(data) True >>> data is str(data) True You have to encode your unicode string to a byte

[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-09 Thread J. Peterson
J. Peterson added the comment: As implemented it's not even possible to send UTF-8, because the "data = str(data)" line only accepts seven bit ASCII with the default encoding. Since there's no easy way to change the encoding "str()" uses, some other mechanism should be available to do the encodi

[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-09 Thread Guido van Rossum
Changes by Guido van Rossum: -- resolution: -> invalid status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing li

[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-09 Thread Christian Heimes
Christian Heimes added the comment: Due to its nature it is impossible to transmit unicode over the wire. Unicode must always be encoded to bytes before it can be stored on the hard disk or transmitted. Typically it's UTF-8 but in your case it depends on the client's browser and the Request heade

[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-08 Thread J. Peterson
J. Peterson added the comment: The diagnostic printed is: File "C:\Apps\Python25\lib\socket.py", line 255, in write data = str(data) # XXX Should really reject non-string non-buffers The comment indicates the developer was aware of the bug. See also similar bug in writelines(), near line

[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-08 Thread J. Peterson
New submission from J. Peterson: Within a do_GET hander for a BaseHTTPServer.BaseHTTPRequestHandler, trying to write unicode data causes a UnicodeEncodeError exception. It should be possible to send Unicode data to the browser. The enclosed Python file demonstrates the issue. Added file: http:

[issue1410] BaseHTTPServer cannot accept Unicode data

2007-11-08 Thread J. Peterson
Changes by J. Peterson: -- components: Library (Lib) nosy: isonno severity: normal status: open title: BaseHTTPServer cannot accept Unicode data type: behavior versions: Python 2.5 __ Tracker <[EMAIL PROTECTED]>