Encode user-enterable strings as UTF-8 before writing.