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

 

 

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to