fixed encoding bug for multiple lines