fixing regression with \ escape and adding support for \r in binary headers