Hi omr,

Thanks for pointing this out and sorry for the delay. I looked at this
initially but didn't work out a test case, now I have.

Here's a page with Content-Type: text/html;charset=ISO-8859-1 and no
accept-charset on the form

http://jscudtest.appspot.com/form_encoding_test2

And here is one with the same content type but it uses accept-
charset="UTF-8" on the form.

I tested these two pages with the following query string:

ローマ字入力

I started with Chrome which gave the following URLs as expected:

(no accept-charset)
http://jscudtest.appspot.com/form_encoding_test2?q=%26%2312525;%26%2312540;%26%2312510;%26%2323383;%26%2320837;%26%2321147;

(with accept-charset)
http://jscudtest.appspot.com/form_encoding_test?q=%E3%83%AD%E3%83%BC%E3%83%9E%E5%AD%97%E5%85%A5%E5%8A%9B

Then I tried in IE6

(no accept-charset)
http://jscudtest.appspot.com/form_encoding_test2?q=%83%8D%81%5B%83%7D%8E%9A%93%FC%97%CD

(with accept-charset)
http://jscudtest.appspot.com/form_encoding_test?q=%E3%83%AD%E3%83%BC%E3%83%9E%E5%AD%97%E5%85%A5%E5%8A%9B

Note that the second URL, which is the page that has accept-charset is
fine. From the report on Stack Overflow it sounded like accept-charset
does work for IE6 if the charset is UTF-8, which is the only one we
will be using for this example.

Excellent question!

Happy coding,

Jeff

On Jun 18, 4:25 am, omr <[email protected]> wrote:
> On April 26, Jeff S. wrote:
>
> > ... I've fixed the [character encoding] issues and
> > went with accept-encoding on the form itself since that
> > should work even if the HTML is in a different character encoding.
>
> I've belatedly learned that Internet Explorer may not apply the
> encoding specified in a form's accept-charset attribute.
>
> Please test your example search page in IE8 (in either normal mode or
> compatibility mode); enter any query containing extended characters,
> and observe that the query value's encoding is *not* UTF-8 (unless the
> browser was already set to use UTF-8 encoding for the search page).
>
> .
>
> See also this discussion:
>
> http://stackoverflow.com/questions/153527/setting-the-character-encod...
>
> -- omr

-- 
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en.

Reply via email to