fix encoding bug while reading from non std connections