In many different code environments’ official documentation I see UTF-8 expressed either as upper- or lower- case, and also with and without the dash. Are there any places where one or the other is important to use?
Some places where these strings are found include:
- The PHP manual in reference to header() arguments (HTTP headers)
- The PHP manual in reference to PHP function arguments
- The PHP manual in reference to internal configuration
- The MySQL manual in reference to configuration
- Python 2 code encoding declaration
- Bash locale configuration
- HTML meta tags
- XML doctypes
The official registry of encodings defines the names as case-insensitive and the spelling as UTF-8 (UTF8 isn’t even a valid alias). It is highly unlikely that any software that can deal with UTF-8 would not recognize the name UTF-8. So in all places, it is important to use UTF-8 and not UTF8.
Since the names are case-insensitive, documentation may use any casing. Software that imposes case restrictions on them would be seriously broken, and I don’t see why would assume that such software exists. Variation in documentation does not mean that some specific casing of letters must be used.