encode filename to os type