0

Today I noticed that google chrome gave me this warning:

'Document.defaultCharset' is deprecated and will be removed in M50, around April 2016.

Considering that it is encouraged to set your page Charset (example), why it is deprecated and what should we use instead of it?

Arashsoft
  • 2,749
  • 5
  • 35
  • 58
  • https://github.com/whatwg/dom/issues/58 suggests that there is no known good use case for the property. What are you using it for? – Alohci Apr 16 '16 at 09:41
  • @Alohci, I think the use case is to create a page that is not UTF8 and tell the browser about it. – Arashsoft Apr 18 '16 at 12:57
  • But defaultCharset just tells you what the charset would have been used if you had not set it explicitly. You don't need to know that to tell the browser what charset you did use. – Alohci Apr 18 '16 at 15:01
  • @Alohci, you are right. There is no need to know it. – Arashsoft Apr 20 '16 at 13:25

1 Answers1

0

As Alohci mentioned in the question comments,

there is no known good use case for the property

Also, it may cause a security issue because the website can guess the user language/country (personal information) based on this value.

The issue is discussed in this link github.com/whatwg/dom/issues/58

Arashsoft
  • 2,749
  • 5
  • 35
  • 58