Encoding added to file read/write.

Will now read/write special characters properly.