473,386 Members | 1,827 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Remove junk character from XML file - UTF8 format

I'm having issues using XmlTextWriter, saving it out to a file with UTF8
encoding, and seeing "human unreadable" characters show up
*right before* the XML declaration.
I need to have the XML declaration state "encoding = utf-8", but also get
rid of the dirty characters. I was hoping that using
System.Text.Encoding.UTF8 in the constructor of the XmlTextWriter class
would prove nice and simple, but I'm finding out I'm having some issues with
it.

but that file encoding should not come in UTF-8 format.

if i remove that that will give junk charactes like ╗┐

please help me find that
Jun 12 '07 #1
1 10015
Dököll
2,364 Expert 2GB
I'm having issues using XmlTextWriter, saving it out to a file with UTF8
encoding, and seeing "human unreadable" characters show up
*right before* the XML declaration.
I need to have the XML declaration state "encoding = utf-8", but also get
rid of the dirty characters. I was hoping that using
System.Text.Encoding.UTF8 in the constructor of the XmlTextWriter class
would prove nice and simple, but I'm finding out I'm having some issues with
it.

but that file encoding should not come in UTF-8 format.

if i remove that that will give junk charactes like ╗┐

please help me find that
Hello, nalinibala!

Try writing the code without utf-8. You will be forced to not include characters therefore...
Jun 15 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: JJ | last post by:
Hi, I have a little, big, boring problem :) I have a utf8 txt file to import in a MySQL db, cause I must create a web-application in PHP for reading this information on-line. I have create...
8
by: Agnes | last post by:
In my .net ,i need to generate an xml file , however, user may input a chinese character, Then , the xml will got something unknow characters. the following is my code, Does anyone know how to...
5
by: lazypig06 | last post by:
Hi ! I am a PHP beginner. I hope somebody can help me with this problem that I've been having. I've been trying to clean up junk data that I have at the begining and ending of an xml file....
37
by: Zhiv Kurilka | last post by:
Hi, I have a text file with following content: "((^)|(.* +))§§§§§§§§" if I read it with: k=System.IO.StreamReader( "file.txt",System.Text.Encoding.ASCII); k.readtotheend()
3
by: CyberSpyders | last post by:
Hi, I have an ASP.Net website, which allows users to upload a file which is then inserted into a database. This is all fine until it reads a line with the string +Anu in it. It transforms...
1
by: sonald | last post by:
Dear All, I am working on a module that validates the provided CSV data in a text format, which must be in a predefined format. We check for the : 1. Number of fields provided in the text file,...
4
by: Index | last post by:
Hi, I am trying to compare a char* with an unsigned char*.I have type cast the later to char*.Now the problem is, the unsigned char* is populated with recv() function over the socket and sometimes...
2
by: nalinibala | last post by:
I'm having issues using XmlTextWriter, saving it out to a file with UTF8 encoding, and seeing "human unreadable" characters show up *right before* the XML declaration. I need to have the XML...
13
by: =?Utf-8?B?YXVsZGg=?= | last post by:
i have come across a situation in my project where i read a text file with some characters greater than hex 0x7f. i need to write character (0xE0) to a new file as an exception. however when i...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.