I recently rediscovered this strange behaviour in Python’s Unicode handling.—Evan

The advantage of raising an error is that the application can deal with the situation in whatever way seems fit (by registering a special error handler or by simply using "ignore" or "replace").

I agree that much of this lies outside the scope of codecs and should be handled at an application or protocol level.—M.-A.