从响应由WCF发送删除UTF-8标识符(BOM) [英] Removing utf-8 identifier (BOM) from Response Sent by WCF
本文介绍了从响应由WCF发送删除UTF-8标识符(BOM)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建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.
这篇关于从响应由WCF发送删除UTF-8标识符(BOM)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文