Handle decoding of bytes to string for Python 3