def _normalizeLineEnds(text, desired='\r\n', unlikely='\x00\x01\x02\x03'):
    """Normalizes different line end character(s).

    Ensures all instances of CR, LF and CRLF end up as
    the specified one."""
    return text.replace('\r\n', unlikely).replace('\r', unlikely).replace('\n',
        unlikely).replace(unlikely, desired)
