fix encoding issues in readUntil