What is the correct UTF8 encoding declaration in XML files? I have seen both.
<?xml version="1.0" encoding="UTF-8"?>
...
or
<?xml version="1.0" encoding="UTF8"?>
...
What is the correct UTF8 encoding declaration in XML files? I have seen both.
<?xml version="1.0" encoding="UTF-8"?>
...
or
<?xml version="1.0" encoding="UTF8"?>
...
The XML specification (https://www.w3.org/TR/REC-xml/#charencoding), says:
In an encoding declaration, the values " UTF-8 ", " UTF-16 ", " ISO-10646-UCS-2 ", and " ISO-10646-UCS-4 " should be used for the various encodings and transformations of Unicode / ISO/IEC 10646...
Further, the value of "encoding" can be any value from IANA-CHARSETS (http://www.iana.org/assignments/character-sets/character-sets.xhtml).
UTF-8 is defined as "UTF-8" or its alias "csUTF8"
Therefore, it should be "UTF-8"