Used correct encoding for test setup and expectation.

The above test was not running for on OSX + 5.4, but was running fine for all versions of Linux.

The issue this changed fixes is:
i) The standard spelling for the encoding is UTF-8 not utf8.
ii) XMLWriter on OSX apparently transparently converts the non-standard spelling to the standard spelling.

That made the test fail on OSX even though it works for Linux machines.