XML Encoding & ASP

Because various computers use different numerical values to represent character sets, XML provides a means for defining which character set is being used. Set this value programatically from Active Server Pages (ASP) to ensure each computer is using the same character set.

  1. Define the Character Set

    • Common character sets include UTF-8, UTF-16 and ISO-8859-1. Define the XML character set by setting the "charset" attribute in the header of the document using:

      <META HTTP-EQUIV="Content-Type" CONTENT="text/xml; charset=UTF-8">

    Character Sets and ASP

    • Programmers must use either the Load() or LoadXML() methods to read an XML string in and set the encoding to one of these two. According to Microsoft, ASP only supports the loading of XML strings or documents encoded in UCS-2 or UTF-8. All other encodings will generate an error message.

    Changing the Encoding

    • Once the XML string has been loaded, you can manipulate the document without concerns for which character set is being used. When the document is saved with the save() method, ASP by default outputs the XML document as UTF-8. You can change this encoding by inserting creating a new processing instruction. For example: createProcessingInstruction("xml", " version='1.0' encoding='ISO-8859-1'");

Related Searches:

References

Resources

Comments

You May Also Like

  • XML & URL Encoding

    A URL, or Uniform Resource Locator, specifies the address of a resource on the Internet. Because URLs are limited to a subset...

  • How to Specify Encoding for XML

    Developers who create programs to read and process XML files face an odd paradox when it comes to determining each file's encoding,...

  • How to Read an XML File in Classic ASP

    An ASP file is an Active Server Page that is a Microsoft Server technology, which is compatible with traditional HTML. Microsoft's Internet...

  • XML to ASCII Conversion

    A chief benefit of XML is that it allows you to tag data and output (or transform) element content into any one...

  • How to Add XML Version 1.0 Encoding

    Although computers make all text look the same by the time a user is reading it, text documents are actually stored differently...

  • Tutorial for Creating ASP Vbscript With Access in Dreamweaver 8

    Active Script Pages let you create Visual Basic code with Access from the Dreamweaver 8 interface. Dreamweaver is an application that helps...

  • How to Change XML Encoding

    Extensible Markup Language (XML) has become the most popular language for data representation, especially for electronic documents available on the Internet. Even...

  • How to Make a Web Page With XML

    Utilizing XML to create a web page allows developers to frequently supply fresh content for the site without having to spend time...

  • How to Use CDATA in XML

    Sometimes within the XML syntax, developers will place a string of input between character data, or CDATA brackets. The information that is...

  • How to Open a JSON

    A JSON is a "JavaScript Object Notation." It is a small file that contains instructions relating to a specific JavaScript function on...

  • How to Create a Website Using Russian Cyrillic Text in Doctype XML

    In order to create a web page using a different language such as Russian Cyrillic, the designer must declare the language in...

  • How to Read XML Encoding

    Extensive Markup Language (XML) provides you with formatted data. The XML programming language is common on the Internet, because it allows software...

  • What Is XML Encoding?

    Computers encode the characters in saved files in a number of possible ways. This encoding refers to how the characters are translated...

  • How to Find XML Encoding

    Extensible Markup Language (XML) is an encoding standard that lets website programmers display data from a database. XML must be denoted using...

  • How to Learn Flash & XML

    There are many useful types of Flash components you can build using XML. If you're learning Flash Web development, it makes sense...

  • How to Write a Web Page Using XML

    The key to creating a Web page using XML is to understand that XML elements must be converted into HTML in order...

Related Ads

Featured