Fixed text encoding bug (issue #86)