mods for safe kind to string encoding