0

I want to use non-english characters on my jquery mobile app and I want to apply UTF-8 Charset to the result returned from Google RSS API. I searched on many sites but I could not find correct answer. I think the charset applied for the Google rss results is not correct ( I checked and it shows null) and thats why I cannot see non-english characters.

Please see below code -

           $.ajax({
            url: "http://ajax.googleapis.com/ajax/services/xxxxxxxxx,
            dataType: "json",
            contentType: "application/x-www-form-urlencoded;charset=utf-8",
                success: function (d) {

                _execute();
                },

or Is there any way to apply UTF-8 charset to javascript string/array?

user20072008
  • 359
  • 7
  • 23
  • So are you getting back `null` from the request or is a object property coming up as `null`? What does the `_execute()` do? Also check your URL's correct. – Qantas 94 Heavy Sep 30 '13 at 05:12
  • URL is striped. URL is correct bcz I get english results correctly but gets garbage characters when expecting for hindi characters. Also I checked content type using function success: function (d,status,xhr) { alert(xhr.getResponseHeader("content-type")); _execute(); } – user20072008 Sep 30 '13 at 06:09
  • Yes I am getting null in the alert box. Either the value is null or xhr object is null. – user20072008 Sep 30 '13 at 06:47
  • It shows blank value for xhr.getAllResponseHeaders() – user20072008 Sep 30 '13 at 08:16
  • I'm seriously unable to reproduce this, going to maktoob.yahoo.com, including jQuery then using `$.ajax('http://maktoob.yahoo.com',{success:function(a,b,c){console.log(a,b,c);console.log(c.getAllResponseHeaders(),c.getResponseHeader('content-type'));}});` works fine. – Qantas 94 Heavy Sep 30 '13 at 08:46
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/38319/discussion-between-jasper-and-qantas-94-heavy) – user20072008 Sep 30 '13 at 08:49
  • This may help you: http://stackoverflow.com/questions/25147511/corrupted-utf-8-encoding-when-reading-google-feed-alerts – André Levy Sep 01 '14 at 08:45

0 Answers0