fixed encoding bug in p file parser