accept-charset attribute (form)
By default, the character set of the form is the same as the character set of the entire document (you can set the character set of the document with the charset attribute of the meta tag).
If any element of the form contains characters that cannot be represented by the character set of the document, then you need to define the accept-charset attribute.
When the form is submitted to a server, the browser uses the character set(s) to convert the text content of the form to a byte stream (the Content-Type HTTP header of the message will contain the used character encoding).Use UTF-8 encoding on your site and in the database of your server to avoid internationalization problems.
String that sets a list of accepted character sets. The name of a character set is case-insensitive. The separator character between the character sets can be a space or a comma. For more information, see the page for character sets.
Example HTML code 1:
This example illustrates the use of the accept-charset attribute:
Did you find this example helpful?
Supported by tags:
User Contributed Comments