FAQ
Hi Fabio,






I cannot see your reply in python-list until I search this question on Internet again.






I try (username.encode('utf-8') + '\r') and the problem is fixed.






Thank you very much.






Viet





You should be able to reproduce the same behavior on PyDev if in your run configuration you select the encoding of the console to be ascii (run > run configurations > select run configuration > common > set >encoding to us-ascii).

>

My guess is that you have the problem because the username has non-ascii chars -- and you're receiving it as an unicode and not a string... so, you have to do encode it properly to a string before writing to the >connection (i.e.: username.encode('utf-8') + '\r' -- although the encoding may have to be a different one and not utf-8).

>

Cheers,

>

Fabio









-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20131127/6f7cdd82/attachment.html>

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 4 | next ›
Discussion Overview
grouppython-list @
categoriespython
postedNov 19, '13 at 8:39a
activeNov 27, '13 at 3:19p
posts4
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase