On Mon, August 18, 2008 4:00 am, Nicolas Dumazet wrote:
Not always, it triggers a UnicodeDecodeError if the unicode string is not convertible into the MediaWiki site's encoding.
It doesn't. It triggers a UnicodeDecodeError if the string passed is non-unicode and cannot be converted using the default (Latin-1) encoding.
Your current implementation is wrong: it converts a bytestring (str) to unicode instead of to the sites encoding. Secondly, throwing a PageNotSaved exception in a function that has nothing to do with a page save (just with a page) is a bit strange...
the only good system is the old system. If needed, catch the UnicodeDecodeException and raise a PageNotSaved exception in the /save/ function.
--Merlijn