added file encoding, partially solve #1