On 18 Feb 2005 19:10:36 -0800, rumours say that [EMAIL PROTECTED] might have
written:
>It's really funny, I cannot send a unicode stream throuth socket with
>python while all the other languages as perl,c and java can do it.
I don't know about perl. What I think you mean by unicode in C most pro
anonymous coward <[EMAIL PROTECTED]> wrote:
> It's really funny, I cannot send a unicode stream throuth socket with
> python while all the other languages as perl,c and java can do it.
Are you sure you understand what Unicode is, and how sockets work?
Sockets are used to transfer byte streams.
On 18 Feb 2005 19:10:36 -0800, <[EMAIL PROTECTED]> wrote:
It's really funny, I cannot send a unicode stream throuth socket with
python while all the other languages as perl,c and java can do it.
then, how about converting the unicode string to a binary stream? It is
possible to send a binary throug
[EMAIL PROTECTED] wrote:
> It's really funny, I cannot send a unicode stream throuth socket with
> python while all the other languages as perl,c and java can do it.
You may really start laughing loudly after you find out that you
can send arbitrary python objects over sockets. If you want langu
It's really funny, I cannot send a unicode stream throuth socket with
python while all the other languages as perl,c and java can do it.
then, how about converting the unicode string to a binary stream? It is
possible to send a binary through socket with python?
--
http://mail.python.org/mailman/
You probably want to use UTF-16 or UTF-8 on both sides of the socket.
See http://www.python.org/moin/Unicode for more information.
So, we have a Unicode string...
>>> mystring=u'eggs and ham'
>>> mystring
u'eggs and ham'
Now, we want to send it over:
>>> to_send=mystring.encode('utf-8')
>>> to_s
Irmen de Jong wrote:
aurora wrote:
You could not. Unicode is an abstract data type. It must be encoded
into octets in order to send via socket. And the other end must
decode the octets to retrieve the unicode string. Needless to say the
encoding scheme must be consistent and understood by bot
aurora wrote:
You could not. Unicode is an abstract data type. It must be encoded
into octets in order to send via socket. And the other end must decode
the octets to retrieve the unicode string. Needless to say the encoding
scheme must be consistent and understood by both ends.
So use pickle
You could not. Unicode is an abstract data type. It must be encoded into
octets in order to send via socket. And the other end must decode the
octets to retrieve the unicode string. Needless to say the encoding scheme
must be consistent and understood by both ends.
On 18 Feb 2005 11:03:46 -0