从响应由WCF发送删除UTF-8标识符(BOM)标识符、WCF、UTF、BOM

由网友(蚀心)分享简介:我创建Facebook的REST API在C#中的克隆,我测试它与Facebook的PHP SDK。我遇到的问题是,我的网REST服务发送的响应包含UTF-8汜在它的前面和Facebook SDK不能正确解析响应。如何解决这个问题的任何想法。I am creating a clone of the facebook...

我创建Facebook的REST API在C#中的克隆,我测试它与Facebook的PHP SDK。我遇到的问题是,我的网REST服务发送的响应包含UTF-8汜在它的前面和Facebook SDK不能正确解析响应。 如何解决这个问题的任何想法。

I am creating a clone of the facebook Rest API in c#, I am testing it with the facebook PHP sdk. The problem I am having is that the responses sent by my net Rest Service contain utf-8 Bom in front of it and Facebook SDK is not able to parse the responses correctly. Any ideas on how to resolve this problem.

推荐答案

如果你可以指定一个特定的编码为您服务,那么你可以使用新UTF8Encoding(假)这是UTF-8无BOM。

If you can specify a specific Encoding to your service, then you can use new UTF8Encoding(false) which is UTF-8 without BOM.

阅读全文

相关推荐

最新文章