[minor] encode to utf-8 before writing to file (custom script)