test: check that the filenames from listdir are in the correct format

Internally there's a lot of UTF-16, but we want to use UTF-8 throughout.
This test currently fails because UTF-16 is leaking.