0
votes

In order to define charset for HTML 5 doctype, which notation should I use?

  1. Short:

    meta charset="utf-8" 
    
  2. Long:

    meta http-equiv="Content-Type" content="text/html; charset=utf-8" 
    
1

1 Answers

1
votes

See the section Specifying the document’s character encoding in the HTML 5.1 spec:

[…] using a meta element with a charset attribute or a meta element with an http-equiv attribute in the encoding declaration state.

So both ways are fine. (But don’t use both in the same document.)