Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Zepto ignores XHR mimeType setting #572

Closed
BS-Harou opened this Issue · 5 comments

3 participants

@BS-Harou

Hi, Zepto completly ignores "mimeType" setting:

$.ajax({
    url: 'fileWithWindows1250Encoding.html',
    mimeType: 'text/html;charset=Windows-1250',
    success: function(data) {
        ///...
    }
};
@mislav
Collaborator

You can try using contentType instead of mimeType

@BS-Harou

No, that obviously doesn't work as "contentType" is supposed to set the request header and "mimeType" is supposed to change the received response header.

@mislav
Collaborator

I misunderstood then.

You're just using it to correctly specify the encoding?

@BS-Harou

Yes I'm working on extension that does a bit of screen scrapping (so I can't change the behavior of the server). The site doesn't send charset parameter in content-type header - only in meta tag -> Widnows-1250. But because it is not in the header, browsers use fallback encoding (utf-8) and do wrong char mapping. Overriding mimeType fixes it.

@mislav mislav was assigned
@madrobby
Owner

We should probably support this, jQuery added this in 1.5.1.

@mislav mislav closed this issue from a commit
@mislav mislav Support `mimeType` Ajax option
Utilizes the native `XHR.overrideMimeType()` method to override the type
or content encoding of the response.

Fixes #572
c18c4d7
@mislav mislav closed this in c18c4d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.