79835505

Date: 2025-12-02 05:27:27
Score: 1.5
Natty:
Report link

You can explicitly declare the character encoding in the XML declaration at the beginning of an XML document using the encoding attribute:

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

Which are the valid xml encoding strings?

Valid XML encoding strings are that identify a character encoding scheme recognized by XML processors. The XML 1.0 specification ensure that all XML processors must support UTF-8 and UTF-16. Encoding names must match with the IANA registered characterset.

https://www.iana.org/assignments/character-sets/character-sets.xml

what is the way of specifying UTF-8?

encoding="UTF-8"

encoding names are case-insensitive so "UTF-8","utf8" are valid.But as per IANA registered name use UTF-8

where I could find a list of the official encoding string?

https://www.iana.org/assignments/character-sets/character-sets.xml

for more reference

What is encoding in XML?

Meaning of - <?xml version="1.0" encoding="utf-8"?>

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: mariya cherian