Advertisement
Home Open Editor ❯

HTML accept-charset Attribute

Example

<form action="action.php" method="get" accept-charset="utf-8">
  <label for="fname">First name:</label>
  <input type="text" id="fname" name="fname"><br>
  <label for="lname">Last name:</label>
  <input type="text" id="lname" name="lname"><br>
  <input type="submit" value="Submit">
</form>

Try this code ❯

Meaning

The accept-charset attribute specifies the list of character encodings for input data that must be accepted by the server processing the form.

The value is a space- or comma-delimited list of character sets as defined in RFC 2045. The default value for this attribute is the reserved value unknown.


Standard Syntax

<form accept-charset="characterSet">


Applies to:

The accept-charset attribute can be used on the following element:

Element Attribute
<form> accept-charset

Advertisement

Attribute Values

Value Description
characterSet Space-separated character encodings the server accepts.

Most common values:

  • UTF-8 - Character encoding for Unicode
  • ISO-8859-1 - Character encoding for the Latin alphabet
Home Open Editor ❯
Advertisement