Encoding only bytes in util.py:bytes_to_str()