十六进制值0X03是无效字符 [英] HEXADECIMAL VALUE 0X03 is an invalid character

查看:2055
本文介绍了十六进制值0X03是无效字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是网页的来源

<html lang="pl">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</head>

<body>
<p>Da&#32;brow&#35;a G�rn&#x3;icza<p>

</body>

</html>

我需要浏览此页面并复制显示的文字

I need to browse this page and copy the text shown

之后,我将此文本粘贴到asp.net mvc应用程序的输入文本框中,以便在数据库中创建新记录. 布局页面的元字符集为"utf-8"

After that, I have pasted this text into an input text box of an asp.net mvc application in order to create a new record into the database. The meta charset of the layout page is "utf-8"

如果我在调试中进入Visual Studio 2013,则在执行控制器的create动作时,我会看到以下字符串

If I go to Visual Studio 2013 in debug, when the create action of the controller is executed, I can see the following string

此地址已存储到类型为nvarchar(255)的列中,并且从sql管理工具中,我看到了与以前相同的文本:

This address has stored into a column of type nvarchar(255), and from sql management tool I see the same text as seen before:

如果我将地址从数据库列复制并粘贴到记事本++中,则可以看到

If I copy and paste the address from database column to notepad++ I can see

此后,我必须调用svc服务才能发送地址数据,但我从另一端收到此异常

After that I have to call a svc service in order to send the address data but I am receiving from the other side this exception

错误转换XML''十六进制值0X03无效 字符.

ERROR TRANSFORMING XML '' HEXADECIMAL VALUE 0X03 is an invalid character.

如何避免抛出此异常?

推荐答案

0x03只是 ,而不是

[2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]

因此,您的文本对象不是XML ,并且任何兼容的XML处理器都必须报告错误,例如收到的错误.

Therefore your textual object is not XML, and any conformant XML processor is obliged to report an error such as the one you received.

在与任何XML库一起使用之前,必须通过手动或自动将数据视为 文本而不是XML 来修复数据.

You must repair the data by treating it as text, not XML, manually or automatically before using it with any XML libraries.

这篇关于十六进制值0X03是无效字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆