translate str instead of unicode, fix doctest