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 depending on a number of factors like the editor used to create the document, or the language the text is in (for example, English or Chinese). The storage method for a document is called its encoding. An XML document is a text document that stores data nested inside tags, and it is trivial to specify the encoding.
Instructions
-
-
1
Determine what encoding your XML editor is using. Where you find this information varies: some editors have a “Format” menu, others allow you to specify the encoding while you save the document. A couple common types of encoding are ISO-8859-1 and UTF-8.
-
2
Copy and paste the following line into the very top of your XML document:
<?xml version="1.0" encoding=”” ?> -
-
3
Type the encoding method you determined in Step 1 into the quotes after the word “encoding” in Step 2. For example, if your editor uses UTF-8 encoding, then the line should read:
<?xml version="1.0" encoding=”UTF-8” ?> -
4
Save your document. The encoding is now correctly specified in the head of the XML document.
-
1
Tips & Warnings
If you’re using Windows Notepad to edit your XML document, the default encoding is “ASCII.”
References
- Photo Credit Jupiterimages/Photos.com/Getty Images