String encoding for Python 2 compat in test