I have a basically question about XML in Android. This line that is shown at the top of XML files <?xml version="1.0" encoding="utf-8"?>
is changeable? I mean we can use for example utf-16 or another version of xml in our codes?
No, there are instances in which the XML encoding and version could or should be different. Different versions of XML are, as expected, different, while different encoding will allow for characters not included in traditional "utf-8" encoding.
EDIT: Re: "Thanks for your answer, I want example for it" & "OK, when do we use utf-16? Is there any code with another version of xml?"
UTF-16 doesn't have much use, as I understand; it is mostly just an old system used for backwards compatibility or for a code that maximizes efficiency with 16-bit over 8-bit. You might use UTF-32 as (from Wikipedia) "the Unicode code points are directly indexed."
From another post on StackOverflow regarding XML versions, "You would only need to use version 1.1 if you are using certain non-ASCII characters in identifiers, EBCDIC line ending characters, or control characters (character codes 1 - 31)."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With