views:

47

answers:

4

Hello.

When the XML file was convert to ASCII. It is different values for user at the three characters of utf and UTF.

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


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

I tried to create a new xml file with vs2005. utf-8 form file generated by default.

which one is a more standard definition? thanks.

+2  A: 

Upper-case is the de-facto standard. It should still work with any combination of case, however.

rspeed
+4  A: 

In my experience (which is primarily with .NET), character set identifiers are treated as case-insensitive, so UTF-8 and utf-8, as well as Utf-8 or any other variation thereof, always mean the same thing. This would also be the case for other character sets, such as ISO-8859-1 (Latin 1), etc. The casing should not matter, as case is not a meaninful factor in such an identifier.

I do extensive work with web services across multiple platforms, and I have never really seen a "standard" form used. I've seen every variation of a variety of character sets...often different variations from a single business partner.

jrista
+5  A: 

From the XML specification:

"XML processors SHOULD match character encoding names in a case-insensitive way"

This indicates that you can use upper case or lower case or even mixed case if you wish. However, the specification uses "UTF-8" in all its examples so for consistency I'd go with that.

Artelius
+1  A: 

The IANA character set registry says:

no distinction is made between use of upper and lower case letters.

But that page, the XML specification, and unicode.org are consistent about capitalizing UTF-8.

dan04
@dan04. I would like to mark your reply as the answer. Thanks for the useful links. @All, Because I need convert the whole xml file to ASCII format and compare the ASCII body .... That's why I care the **upper and lower case letters.**. thank you all.
Nano HE