Initial changes to use encoding when reading text.