On 26 Apr 2005 13:39:26 -0700, [EMAIL PROTECTED] (dumbkiwi) wrote:

>Peter Otten <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
>> Dumbkiwi wrote:
>> 
>> >> Just encode the data in the target encoding before passing it to
>> >> os.popen():

>
>Anyway, from your post, I've done some more digging, and found the
>command:
>
>sys.setappdefaultencoding()
>
>which I've used, and it's fixed the problem (I think).
>

Dumb Kiwi, eh? Maybe not so dumb -- where'd you find
sys.setappdefaultencoding()? I'm just a dumb Aussie [1]; I looked in
the 2.4.1 docs and also did import sys; dir(sys) and I can't spot it.

In any case, how could the magical sys.setappdefaultencoding() fix
your problem? From your description, your problem appeared to be that
you didn't know what encoding to use.

What is the essential difference between

   send(u_data.encode('polish'))

and

   sys.setappdefaultencoding('polish')
   ...
   send(u_data)

[1]: Now that's *TWO* contenders for TautologyOTW :-)

Cheers,

John

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

Reply via email to