Message11631

Author jeff.allen
Recipients jeff.allen
Date 2017-10-25.16:03:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1508947412.01.0.213398074469.issue2632@psf.upfronthosting.co.za>
In-reply-to
Content
Actually, non-ascii text is ok unless you supply it as a unicode. In that case, we buffer up the Java chars internally (UTF-16), and then try to treat this String as bytes, hence the error. If the client supplies a unicode object, I believe we should be encoding it with the default encoding. In the same circumstances, CPython says something like:

UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 12: ordinal not in range(128)

So the StringBuilder can stay, but we ought to encode unicode objects as they arrive, if only so that we can fail the way CPython does.
History
Date User Action Args
2017-10-25 16:03:32jeff.allensetmessageid: <1508947412.01.0.213398074469.issue2632@psf.upfronthosting.co.za>
2017-10-25 16:03:32jeff.allensetrecipients: + jeff.allen
2017-10-25 16:03:31jeff.allenlinkissue2632 messages
2017-10-25 16:03:31jeff.allencreate