'Test with UTF8 data.'

@pytest.mark.parametrize('data', ['Hello    World', 'Snowman!    \xe2\x98\x83'])
def test_utf8(self, data, tmpdir):

    filename = (tmpdir / 'foo')
    filename.write('Old    data')
    with qtutils.savefile_open(str(filename)) as f:
        f.write(data)
    assert (tmpdir.listdir() == [filename])
    assert (filename.read_text(encoding='utf-8') == data)
