如何从一个XML文件中删除看不见垃圾字符 [英] How to remove invisible junk characters from a XML file

查看:521
本文介绍了如何从一个XML文件中删除看不见垃圾字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想读一些XML文件。

I want to read some xml files.

当我打开这些文件,用记事本/写字板/ MS Word或任何浏览器,它是开放其原始form.But当我试图与MS-DOS,一股无形的chacter像来执行它的∩╗┐ 被看到。
我想,∩╗┐是建立一个error.i正在寻找错误的内容是不是在序言中不允许的。

when i am opening these files with notepad/wordpad/MS Word or any Browser, it is opening in its original form.But when i tried to execute it with MS DOS, an invisible chacter like "" is seen. I think '' is creating an error.i am finding the error "Content is not allowed in prolog."

请告诉我如何从XML文件中使用C#code删除此不可见的垃圾字符。

Please tell me how can i remove this invisible junk characters from xml file using C# code.

先谢谢了。

推荐答案

这可能是 UTF-8字节阶标记。许多文本编辑器(如记事本+ +和jEdit的)允许您指定是否应BOM为UTF-8或不能写入。随着Windows记事你唯一的选择是将文件保存为ANSI。

That might be the UTF-8 byte-order mark. Many text editors (for example Notepad++ and jEdit) allow you specify whether the BOM should be written for UTF-8 or not. With Windows Notepad your only option is to save the file as ANSI.

这篇关于如何从一个XML文件中删除看不见垃圾字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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