Click Here

ENCODING attribute specifies how is that characters are encoded XML content.

It is important to specify the encoding correct, ie, set as the value of encoding (ISO-8859-1, UTF-8, windows-1252, UTF-16) on which are engraved the XML data.

There are 2 types of encoding according to storage size:


It encodes each character in a single byte, and can have different formats: WINDOWS-1252, UTF-8, ISO-8859-1.

In English we often use UTF-8

In Spanish and Latin alphabets, using ISO-8859-1 for accents and

The Windows Notepad program records by default in "SINGLE-BYTE".

<?xml version="1.0" encoding="UTF-8"?>

<?xml version="1.0" encoding="ISO-8859-1"?>

<?xml version="1.0" encoding="windows-1252"?>


It encodes each character in 2 bytes, also known as Unicode, and the format is UTF-16

If we record the data in UNICODE, serve for all languages, but you have to specify mandatory in the XML encoding = UTF-16.

Windows NOTEPAD program to record a document in UNICODE (SAVE AS UNICODE)

<?xml version="1.0" encoding="UTF-16"?>

Click Here