Author dabeaz
Recipients dabeaz, mark.dickinson, r.david.murray, rhettinger
Date 2010-12-28.00:21:08
SpamBayes Score 1.4287e-07
Marked as misclassified No
Message-id <1293495671.9.0.54616848367.issue10783@psf.upfronthosting.co.za>
In-reply-to
Content
I encountered this issue is in the context of distributed computing/interprocess communication involving binary-encoded records (and encoding/decoding such records using struct). At its core, this is all about I/O--something where encodings and decoding matter a lot.  Frankly, it was quite surprising that a unicode string would silently pass through struct and turn into bytes.  IMHO, the fact that this is even possible encourages a sloppy usage of struct that favors programming convenience over correctness--something that's only going to end badly for the poor soul who passes non-ASCII characters into struct without knowing it. 

A default encoding might be okay as long as it was set to something like ASCII or Latin-1 (not UTF-8).  At least then you'd get an encoding error for characters that don't fit into a byte.
History
Date User Action Args
2010-12-28 00:21:12dabeazsetrecipients: + dabeaz, rhettinger, mark.dickinson, r.david.murray
2010-12-28 00:21:11dabeazsetmessageid: <1293495671.9.0.54616848367.issue10783@psf.upfronthosting.co.za>
2010-12-28 00:21:08dabeazlinkissue10783 messages
2010-12-28 00:21:08dabeazcreate