Fixed utf-8 decoding bug in open files