Hi Benjamin,

> As long as i know qooxdoo is entirely in UTF-8
> I'm wondering why when sending a qx.remote.request
> The used charset is set to ISO-8859-1,utf-8;q=0.7,*;q=0.7

In your example, you were using the Script transport. It's not possible to set 
any request headers with this transport method. Still, even with XHR its not 
possible to customize the header. To bring some light into this, let me quote 
from the XMLHttpRequest2 spec:

„The above headers [including Accept-Charset] are controlled by the user agent 
to let it control those aspects of transport. This guarantees data integrity to 
some extent.“

(http://www.w3.org/TR/XMLHttpRequest2/, 3.6.2. The setRequestHeader() method)

In other words, you cannot set the Accept-Charset from code.

> It seem weird to me.
> According to the fact that qooxdoo is fully utf8, the request should be 
> utf-8, and ask for utf-8 too.

If I interpret the Accept-Charset header correctly, the browser does in fact 
request UTF-8 with the same priority as ISO. I guess servers that have UTF-8 
available will therefore usually respond with UTF-8. Moreover, I believe the 
charset header requested is not mandatory for the HTTP server.

Here is an example with curl (a command line http client)

# Prefer ISO-8859-1…
$ curl -v -I http://www.google.com -H "Accept-Charset: ISO-8859-1,q=0.7"
> …
> Accept: */*
> Accept-Charset: ISO-8859-1,q=0.7
> …
# … but response is UTF-8
< HTTP/1.1 302 Found
< Content-Type: text/html; charset=UTF-8

(> precedes the request headers, < the response headers)

> Maybe the reason for this is to fully support the http standard, which says 
> that without charset definition, the default should be latin 1??

Perhaps, including Latin-1 at the beginning of the String is some kind of 
workaround to ensure backwards compatibility?

Regards
Tristan
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to