Especially in python 2.4 and earlier, this little buddy can be a pretty useful companion when working with
fileinput or file objects returned by
fileinput in 2.5 can handle the decoding via the new
def unicodeiter(iterable, encoding="utf-8"): for item in iterable: yield unicode(item, encoding)
Not exactly rocket science, but still.