[EMAIL PROTECTED] wrote: > HELP! > Guy who was here before me wrote a script to parse files in Python. > > Includes line: > print u
According to your other posts 'u' seems to be an instance of a custom Utterance class with a __str__() method that accidentally returns unicode. Try changing the print statement to print unicode(u) If you're lucky, it works. Otherwise we need a piece of the actual code. To give you an idea what a self-contained demonstration of your problem might look like: >>> class Utterance(object): ... def __str__(self): return u"äöü" ... >>> u = Utterance() >>> print u Traceback (most recent call last): File "<stdin>", line 1, in <module> UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128) >>> print unicode(u) äöü Peter -- http://mail.python.org/mailman/listinfo/python-list