> try: > # this will validate UTF-8 > string = unicode(string, 'utf-8', 'strict') > except UnicodeError, e: > # replaces invalid chars with '?' > string = unicode(string, 'iso-8859-1', 'replace') > > return string Thanks, I wasn't aware that unicode.encode() was able to do the replacement internally. -sv