Revert "Removed unnecessary code, and changed file reader and writer classes to utf-8 encoding"

This reverts commit 1672385305b4c1d65091a8d2f388b7c111dcd23a.
Revert
Corrected encoding