[Pyobjc-dev] Re: non-default encoding raising an exception over the bridge
Brought to you by:
ronaldoussoren
From: Michael H. <mw...@py...> - 2003-11-24 11:47:07
|
Just van Rossum <ju...@le...> writes: > Bob Ippolito wrote: > >> I think that most of the time, people would be happier if this didn't >> raise an exception (use the unicode replace instead). If the python >> user doesn't know the encoding of the text, and it's not default >> encoding, the developer probably doesn't have anything better than >> replace to use on the string. The exception is a nuisance and can be >> hard to track down. >> >> Perhaps this could be a module level variable in objc, so that a >> person could toggle it to be strict if they wanted it that way, but >> have the default as replace? > > Strongly disagree. This leads to silent errors, possibly even data loss. > You _have_ to know the encoding, and you _have_ to deal with it. If > there's no way you can know the encoding, you have to explicitly tell > which encoding or behavior to use. Amen. Cheers, mwh -- When physicists speak of a TOE, they don't really mean a theory of *everything*. Taken literally, "Everything" covers a lot of ground, including biology, art, decoherence and the best way to barbecue ribs. -- John Baez, sci.physics.research |