Apparently that parameter controls the input encoding. But in our case it's unicode, so using 'UTF-8' fails.

The output is encoded to utf-8 later on.