My website is set to UTF-8, do i have to set my forms also to utf-8 using the accept-charset for forms?
My guestbook for example allows multi-language so my guestbook database table is utf8_unicode_ci
and all my webpages use the same template so the encoding for all pages is utf-8, because I set the charset for my webpages as utf-8 do i have also set the form charset to utf-8 or no because I already set it for the webpage itself?
Reason why is I am converting my website to utf-8 and don't really want to go through all my site forms adding the form charset utf-8 attribute.
Typically if the page is served explicitly with
UTF-8
, the form inputs will also be encoded in that character set.It defaults to the character encoding/charset that the page was served with. You just need to ensure your response header has content-type with charset=utf-8
Almost every decent browser ignores the
accept-charset
attribute in favour of the encoding of the page with the form as it is defined incharset
param of theContent-Type
response header. The attribute works as far only in MSIE and even then, it is using it wrong. In MSIE running on Windows, any other value than UTF-8 would be interpreted as CP-1252.Don't use this attribute. It's useless.