HTML <form> accept-charsetAttribute
Examples
A form with the accept-charset attribute:
First name: <input type="text" name="fname"><br>
Last name: <input type="text" name="lname"><br>
<input type="submit" value="提交">
</form>
Try it Yourself »
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the accept-charset attribute.
Definition and Usage
The accept-charset attribute specifies the character encodings to be used for the form submission.
The default value is the reserved string "UNKNOWN" (indicating that the encoding is the same as the encoding of the document containing the <form> element).
Differences between HTML 4.01 and HTML5
In HTML 4.01, the character encoding list can be separated by spaces or commas. In HTML5, the list must be separated by spaces.
Syntax
Attribute Values
| Value | Description |
|---|---|
| character_set | A list of character encodings to be used for the form submission; multiple character encodings are separated by spaces. Common values:
Theoretically, any character encoding can be used, but no browser understands all encodings. The more widely a character encoding is used, the better browser support it has. To view all available character encodings, please visit ourCharacter Encoding Reference Manual。 |
HTML <form> Tag Other Extensions