C Board  

Go Back   C Board > General Programming Boards > C# Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 10-29-2009, 02:46 AM   #1
Registered User
 
Join Date: Mar 2009
Posts: 48
XML Encode Help.

Hi all,

i am develop a small tool with C# for converting the ASCII format xml file to UTF-8 format.

What's the different for the below two line? Which one is better to use.

<?xml version="1.0" encoding="us-ascii"?>

<?xml version="1.0" encoding="ascii"?>

Code:
            XmlDeclaration xmldecl;

            ......

            xmldecl = doc.CreateXmlDeclaration("1.0", "us-ascii", null);
Thanks in advance.


BR!

Pingz
__________________
--------------------------------------------------------
Newbie
C/C#/C++
swimming/cycling/running
There is nothing more powerful than an idea.
Except for an idea put into action.
--------------------------------------------------------

Last edited by userpingz; 10-29-2009 at 02:50 AM. Reason: add code
userpingz is offline   Reply With Quote
Old 11-08-2009, 10:41 PM   #2
(?<!re)tired
 
Mario F.'s Avatar
 
Join Date: May 2006
Location: Portugal
Posts: 5,220
Neither of them, don't you think?
If you want to use UTF-8 encoding you use:
Code:
<?xml version="1.0" encoding="UTF-8"?>
ascii is a subset of UTF-8 and us-ascii is simply another name for ascii.
__________________
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.


Mario F. is offline   Reply With Quote
Old 11-12-2009, 08:06 PM   #3
Registered User
 
Join Date: Mar 2009
Posts: 48
Smile

Quote:
Originally Posted by Mario F. View Post
Neither of them, don't you think?
If you want to use UTF-8 encoding you use:
Code:
<?xml version="1.0" encoding="UTF-8"?>
ascii is a subset of UTF-8 and us-ascii is simply another name for ascii.

Thank you Mario. :-)
__________________
--------------------------------------------------------
Newbie
C/C#/C++
swimming/cycling/running
There is nothing more powerful than an idea.
Except for an idea put into action.
--------------------------------------------------------
userpingz is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Parsing Xml deviousdexter C# Programming 7 04-24-2009 06:29 AM
Dissecting an Excel XML spreadsheet desmond5 C++ Programming 1 05-22-2008 04:32 PM
XML encoding issue George2 C# Programming 1 05-16-2008 05:21 AM
XML and data exchange seexml C Programming 0 04-27-2006 03:02 PM
Need help with this xml tree example kzar C Programming 1 11-22-2004 11:23 AM


All times are GMT -6. The time now is 12:27 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22