utils.str: Prevent issue with tokens like '\x80' in Python 3.