in reply to [not perl] unicode/utf8 in browsers and OS's - where does conversion happen?

This is very good question and I'm looking forward to all good responses. I'd like to add my two cents though.

Personally I just generate the page in utf-8, put into the content-type header that charset is utf-8 and add the accept-charset attribute to the form tag and hope that the client does the right thing:

<form [...] accept-charset="utf-8"> [...] </form>

This seems to work fine and the content from the clients does come in utf-8.

  • Comment on Re: [not perl] unicode/utf8 in browsers and OS's - where does conversion happen?
  • Download Code

Replies are listed 'Best First'.
Re^2: [not perl] unicode/utf8 in browsers and OS's - where does conversion happen?
by danmcb (Monk) on Jan 06, 2008 at 18:39 UTC

    right. I have been doing that do. But if the submision happens via AJAX rather than the normal browser form submision, does the javascript still see utf8? Always?

    A little googling suggests that support for accept-charset is patchy across browsers, so I have been wondering about relying on this. Haven't done any hard tests though.