accept-charset
HTML accept-charset Attribute (HTML接受字符集属性)
The HTML accept-charset attribute specifies the character encoding that must be used for the form submission. (HTML accept-charset属性指定表单提交必须使用的字符编码。)
You can use this attribute only on the <form> element.
The attribute value contains a list separated value of one or more encodings. The default value of the attribute is “UNKNOWN”, which indicates that the encoding equals the encoding of the document having the <form> element.
Syntax
Syntax (语法)
<form accept-charset="character_set"></form>
Example of the HTML accept-charset attribute:
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
<style>
input {
display: block;
margin-bottom: 10px;
}
</style>
</head>
<body>
<form action="/form/submit" accept-charset="ISO-8859-1" method="post">
<input type="text" name="name" placeholder="Enter your Name">
<input type="text" name="surname" placeholder="Enter your Surname">
<input type="number" name="age" placeholder="Enter your Age">
<input type="submit" value="Send">
</form>
</body>
</html>