Jose Galvez wrote: > I've done similar stuff to try and catch unicode errors too. I guess my > point is since pylons pushes unicode and mako pushes unicode python will > all be in unicode with version 3, why write code to catch an error, when > it doesn't have to be an error? doesn't adding the magic encoding > comment remove the need for much of the code we write to "catch them"?
nope -- all that does is specify what encoding the source file is in - so it effects literals -- that's it. If you are getting unicode objects and strings intermixed from DB queries, etc, that's another problem. I like to think of it like this: Use unicode entirely inside your app. encode/decode (or make sure you know the encoding of the source) EVERY TIME you do any IO -- reading writing files, getting to to/from a database, etc. Where this gets ugly is legacy data that may be in mixed encodings - arrgg! -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
