加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何添加xml编码<?xml version =“1.0”encoding =“UTF-8”

发布时间:2020-12-16 07:56:12 所属栏目:百科 来源:网络整理
导读:可能是一个没有答复的副本. SQL Server 2008 – Add XML Declaration to XML Output 请让我知道,如果这是可能的.我读了一些博客 http://forums.asp.net/t/1455808.aspx/1 http://www.devnewsgroups.net/group/microsoft.public.sqlserver.xml/topic60022.asp
可能是一个没有答复的副本.
SQL Server 2008 – Add XML Declaration to XML Output

请让我知道,如果这是可能的.我读了一些博客

http://forums.asp.net/t/1455808.aspx/1

http://www.devnewsgroups.net/group/microsoft.public.sqlserver.xml/topic60022.aspx

但是我不明白为什么我不能这样做.

你必须手动添加它. SQL Server始终将xml内部存储为ucs-2,因此SQL不可能生成一个utf-8编码头

请参阅MSDN上的“Limitations of the xml Data Type”

The XML declaration PI,for example,<?xml version='1.0'?>,is not preserved when storing XML data in an xml data type instance. This is by design. The XML declaration (<?xml ... ?>) and its attributes (version/encoding/stand-alone) are lost after data is converted to type xml. The XML declaration is treated as a directive to the XML parser. The XML data is stored internally as ucs-2.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读