On Fri, 2003-04-11 at 15:54, "Martin v. Löwis" wrote: > To avoid breakage, you could define ugettext as > > def ugettext(self, message): > if isinstance(message, unicode): > tmsg = self._catalog.get(message.encode(self._charset)) > if tmsg is None: > return message > else: > tmsg = self._catalog.get(message, message) > return unicode(tmsg, self._charset) I suppose we could cache the conversion to make the next lookup more efficient. Alternatively, if we always convert internally to Unicode we could encode on .gettext(). Then we could just pick One Way and do away with the coerce flag. -Barry
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4