开发者

Is form charset required?

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 sam开发者_如何学JAVAe 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.


Almost every decent browser ignores the accept-charset attribute in favour of the encoding of the page with the form as it is defined in charset param of the Content-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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜