Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#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 13 years ago by dylan

Milestone: 0.4

comment:2 Changed 13 years ago by dylan

Component: GeneralIO
Owner: changed from anonymous to alex

comment:3 Changed 13 years ago by James Burke

Owner: changed from alex to James Burke

Stealing io and package bugs from Alex. Holler if you want it back.

comment:4 Changed 13 years ago by James Burke

Resolution: wontfix
Status: newclosed

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/

comment:5 Changed 12 years ago by (none)

Milestone: 0.4

Milestone 0.4 deleted

Note: See TracTickets for help on using tickets.