本文介绍了什么是“= C2 = A0”在MIME编码,引用可打印的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  MIME-version:1.0 
Content-键入:text / html; charset = UTF-8
内容传输编码:quoted-printable
X-Mailer:Verizon Webmail
X-Origination-IP:[xxxx]

= C2 = A0test测试测试123

什么是= C2 = A0?我已经尝试了六打可打印的解析器,但是没有人正确地处理。



老实说,现在我正在编码:

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

因为我不知道MIME内容中随机出现的文字,应该被渲染成任何东西。为了清楚,我知道(= [0-9A-F] {2 })是一个编码字符。但是在这种情况下,它似乎代表NOTHING。

解决方案

= C2 = A0表示字节C2 A0。然而,由于这是UTF-8,它转换为00A0,这是不间断空间的Unicode。



请参阅


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.

解决方案

"=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 http://en.wikipedia.org/wiki/UTF-8

这篇关于什么是“= C2 = A0”在MIME编码,引用可打印的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 02:02