Mon Jul 26 21:25:37 CDT 2010
On Mon, Jul 26, 2010 at 6:12 PM, Fernando Perez <email@example.com>wrote:
> [ I'm cc'ing the list on this, which may be of general interest ]
> On Mon, Jul 26, 2010 at 2:14 PM, MinRK <firstname.lastname@example.org> wrote:
> > Basically, the question revolves around what should we do with non-ascii
> > unicode messages in this situation:
> > msg=u'ç'
> > a.send(msg)
> > s = b.recv()
> Shouldn't send/receive *always* work with bytes and never with
> unicode? Unicode requires knowing the encoding, and that is a
> dangerous proposition on two sides of the wire.
Yes, 0MQ and pyzmq should always deal with bytes.
> If a message is unicode, it should be encoded first (to utf-8) and
> decoded on the other side back to unicode.
> There is then the question of the receiving side: should it always
> decode? If not, should a flag about bytes/unicode be sent along?
That is really for an application to handle on a per message basis. The
most reasonable options are:
1. Put encoding/decoding info in the message content.
2. Always encode and decode in the application.
> Not sure...
Brian E. Granger, Ph.D.
Assistant Professor of Physics
Cal Poly State University, San Luis Obispo
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev