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

こ雲淡風輕ζ 提交于 2020-01-08 16:26:25

问题


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.


回答1:


"=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).




回答2:


%C2%A0 This is the code of a hidden folder, create a hidden folder and save in it, for example, a text file, then open this file through a browser and you will see these characters in the search bar. As I understand it, these characters are optional and do not translate to other code.



来源:https://stackoverflow.com/questions/2774471/what-is-c2-a0-in-mime-encoded-quoted-printable-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!