[I18n-sig] Unicode experience
Fri, 07 Jul 2000 13:15:49 +0200
Toby Dickenson wrote:
> I'm just nearing the end of getting Zope to play well with unicode
> data. Most of the changes involved replacing a call to str, in
> situations where either a unicode or narrow string would be
> My best alternative is:
> def convert_to_something_stringlike(x):
> if type(x)==type(u''):
> return x
> return str(x)
> This seems like a fundamental operation - would it be worth having
> something similar in the standard library?
You mean: for Unicode return Unicode and for everything else
return strings ?
It doesn't fit well with the builtins str() and unicode(). I'd
say, make this a userland helper.
BTW, could you elaborate a bit on your experience with adding
Unicode support to Zope ? Such a report would certainly make
a nice complement to the Unicode tutorial and help other
people adding Unicode support to their apps.
Python Pages: http://www.lemburg.com/python/