On 31. Mar 2007, at 17:28, Henrik Nyh wrote:
Allan Odgaard wrote:
Finally a question: If your web-site is all in latin-1, how do you deal with user input, if any? I.e. if I can post comments or in some other way submit arbitrary plain text to your site, you just pray I restrain myself to latin-1, and that the browser sends my text as latin-1? ;)
You can specify the accept-charset attribute for a form; otherwise it will default to the document's encoding, with varying behaviour for unknown sequences: http://www.intertwingly.net/blog/1761.html
That it defaults to the documents encoding is the suggested behavior, not required.
However, my question was meant for someone who actually sends pages as latin-1 (as I would guess the OP does).
If you accept user content and display it on your site (like his login name), you sort of have to set the accept encoding to utf-8 and then entity-encode that accepted text (so that it can be displayed on the pages you serve).