Item names may contain non-ascii characters

Encoded the item name in UTF-8 before using it to create the output files since it caused a crash if the item name contained non-ascii characters.
Merge pull request #2 from samalander/patch-1

Encode item names in UTF-8 to avoid crashes where names contain non-ascii characters.