谷歌的编码问题Base64和PHP德code [英] Google encoding issue base64 and PHP decode
问题描述
好吧,我有一个复杂的问题。我会尽量解释清楚。
Ok I have a complex issue. I will try to explain clearly.
我转发来自谷歌电子邮件到一个PHP脚本。如果我使用一个@符号连接它codeS它立足64,你看下面的例子。我可以去code,但有时邮件没有@符号,因此它不会EN code IT在电子邮件......如果我在我的PHP code运行的base64所有脚本时间会去code,即使它不具有扰乱了文字。
I am forwarding an email from google to a php script. If I use an "@" symbol it encodes it to base 64 as you see the example below. I can decode it but sometimes emails do not have the "@" symbol so it DOES NOT ENCODE IT IN THE EMAIL... and if I run the base64 script in my php code all the time it will decode even when it doesn't have to and mess up the text.
有意义吗?
下面是获取连接codeD的例子,因为是使用了@符号:
Below is an example that gets encoded because there is an "@" symbol used:
Example ONE I sent this: sample@sample.com
=============================================
The email came out like this.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
Content-Transfer-Encoding: base64
U2FtcGxloXNhbXBsZS5jb20NCg0KLS0NClNlbnQgdXNpbmcgU01TLXRvLWVtYWlsLiAgUmVwbHkg
dG8gdGhpcyBlbWFpbCB0byB0ZXh0IHRoZSBzZW5kZXIgYmFjayBhbmQgIA0Kc2F2ZSBvbiBTTVMg
ZmVlcy4NCmh0dHBzOi8vd3d3Lmdvb2dsZS5jb20vdm9pY2UNCg==
------------------------------------------------------
------------------------------------------------------
Example TWO I sent this: Hello World
======================================================
The email came like this:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes
Hello world
我
如何测试如果连接codeD,然后哪能带code将其正确?
How can I test if its encoded and then how can I encode it correctly?
太感谢了。
-Ed
推荐答案
答案就在那里,看看下面的标题:
The answer is just there, look at the following header:
Content-Transfer-Encoding: base64
它告诉你内容是EN codeD使用base64编码。
It tells you that the content is encoded using base64 encoding.
这篇关于谷歌的编码问题Base64和PHP德code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!