What is "=C2=A0" in MIME encoded, quoted-printable text?

TheSoftwareJedi picture TheSoftwareJedi · May 5, 2010 · Viewed 68.5k times · Source

This is an example raw email I am trying to parse:

MIME-version: 1.0
Content-type: text/html; charset=UTF-8
Content-transfer-encoding: quoted-printable
X-Mailer: Verizon Webmail
X-Originating-IP: [x.x.x.x]

=C2=A0test testing testing 123

What is =C2=A0? I have tried a half dozen quoted-printable parsers, but none handle this correctly. How would one properly parse this in C#?

Honestly, for now, I'm coding:

//TODO WTF
encoded = encoded.Replace("=C2=A0", "");

Because I can't figure out why that text is there randomly within the MIME content, and isn't supposed to be rendered into anything. By just removing it, I'm getting the desired effect - but WHY?!

To be clear, I know that (=[0-9A-F]{2}) is an encoded character. But in this case, it seemingly represents NOTHING.

Answer

Steven Sudit picture Steven Sudit · May 5, 2010

"=C2=A0" represents the bytes C2 A0. However, since this is UTF-8, it translates to 00A0, which is the Unicode for non-breaking space.

See UTF-8 (Wikipedia).