make key creation work with unicode