#487 closed defect (wontfix)
dojo.bind charset auto detection
Reported by: | Moe | Owned by: | James Burke |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | IO | Version: | 0.2 |
Keywords: | dojo.bind charset | Cc: | |
Blocked By: | Blocking: |
Description
Hi,
i found out dojo has problems to detect the correct charset of a page, when it's not specified.
I loaded a page with:
dojo.io.bind({ url: "bereich_reservieren.php", load: function(type, data, evt){ document.getElementById('nummernreservierung').innerHTML = data; }, mimetype: "text/html"});
and it replaced the german 'umlaute' (ä,ö,ü) to question marks (?) which is (as far as I know) typical when a ISO-8859-1 Document is mistaken as UTF-8 encoded. Therefore I added the following line in the "bereich_reservieren.php" to specify the charset of the page loaded:
header("Content-type: text/html; charset=ISO-8859-1");
and it worked.
I saw that there is a property djConfigbindEncoding? but setting this to
djConfig["bindEncoding"] = 'ISO-8859-1';
didn't work.
I found this line in the io.js but it doesn't seem to be used:
kwArgs.encoding = dojo.lang.firstValued(kwArgs["encoding"], djConfig["bindEncoding"], "");
This problem also occurs when using Panes.
Change History (5)
comment:1 Changed 15 years ago by
Milestone: | → 0.4 |
---|
comment:2 Changed 15 years ago by
Component: | General → IO |
---|---|
Owner: | changed from anonymous to alex |
comment:3 Changed 15 years ago by
Owner: | changed from alex to James Burke |
---|
comment:4 Changed 15 years ago by
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The "bindEncoding" and "encoding" params mentioned in Dojo above are for helping construct the request to the server, but do not deal with the response. AFAIK, we do not have control over the charset of the response, and XMLHttpRequest assumes UTF-8. Closing this as wontfix, because we cannot fix it. The server needs to send the right charset in the HTTP response headers.
Another reference: http://erik.eae.net/archives/2005/05/27/18.55.22/
Stealing io and package bugs from Alex. Holler if you want it back.