Subject: All CRLF XML files are not recognized as CRLF, so flood with ^M's

From: 積丹尼 Dan Jacobson <[email-masked]>
Date: Mon, 15 Jul 2019 04:09:52 +0800

Gentlemen, it's terrible.

All CRLF XML files will end up looking like this in your buffer,

$ cat -v l.gpx
<?xml version="1.0" encoding="utf-8"?>^M
<a></a>^M

See those ^M's?
That's because that
   <?xml version="1.0" encoding="utf-8"?>
line causes emacs to screw up recognizing
the CRLFs! See (info "(emacs) Coding Systems").
emacs-version "26.1"

See also bug#20623.

OK I tried it on a CRLF file like
<?xml version="1.0"?>
<a></a>

So it is indeed the UTF-8 it is unhappy about.

Workaround:
Don't use UTF-8, use plain ASCII when using XML in emacs. Great.