fix: Add output encoding to tests for Python3

In certain environment setups python 3 will detect the appropriate
output as ASCII and will fail when trying to write a unicode string.
Override this by forcing UTF-8.