[I18n-sig] Unicode experience

Toby Dickenson tdickenson@geminidataloggers.com
Fri, 07 Jul 2000 10:53:39 +0100


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
acceptable.

My best alternative is:

def convert_to_something_stringlike(x):
    if type(x)=3D=3Dtype(u''):
        return x
    else:
        return str(x)

This seems like a fundamental operation - would it be worth having
something similar in the standard library?



Toby Dickenson
tdickenson@geminidataloggers.com