Adding utf-8 encoding when reading and writing in keyhandler, was crashing without this