added explicit utf-8 encoding to text file read and write
added explicit utf-8 encoding to text file read and write

On normal UTF-8 enabled terminals, Python 3 automatically uses UTF-8. But in our HPC environments, this is not necessarily the case, so we need to explicitly set the encoding. I supposed it is safe to generally set the input and output files to UTF-8.
lowerquality/gentle,lowerquality/gentle,lowerquality/gentle,lowerquality/gentle