High Performance Industrisl Soluations

Advanced PHP, MySQL and web security related topics brought to you by PHP Guruji.

accept-charset (HTML attribute)

The accept-charset attribute specifies the character encodings that the server can handle or process for input data.

Example

In this form, we tell the server to accept Windows-only character sets (which isn’t a brilliant idea, to be honest):



<form action="form-to-email.php" method="post"
accept-charset="windows-1252">
<div>
<label for="txtname">Name:</label>
<input type="text" name="txtname" id="txtname"/>
</div>

</form>




Value

This attribute can accept a space- and/or comma-delimited list of charset values. The default value for this attribute is the reserved string “UNKNOWN.” Browsers may interpret this value as the character encoding specified in the head of the document.


Internet Explorer’s support for accept-charset is buggy. If the attribute’s specified as "ISO-8859-1", IE will happily send data encoded as "Windows-1252".

0 comments: