Using encoding for write_file to fix --icon issue as per this link:

https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20131202/1153359.html