Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7663667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:06:25+00:00 2026-05-31T14:06:25+00:00

I tried to retrieve XML Google weather API from this URL: http://www.google.com/ig/api?weather=,,,24467280,39606640&hl=ar It is

  • 0

I tried to retrieve XML Google weather API from this URL:

http://www.google.com/ig/api?weather=,,,24467280,39606640&hl=ar

It is in Arabic language.

I used: NSURLConnection to retrieve this data and then parsed it by NSXMLParser.

The received data is not correctly encoded.I tried to put it in XML file after imported it and I found data like this:

<?xml version="1.0"?><xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0" ><forecast_information><city data=""/><postal_code data=""/><latitude_e6 data="21429730"/><longitude_e6 data="39828370"/><forecast_date data="2012-03-14"/><current_date_time data="2012-03-14 17:00:00 +0000"/><unit_system data="SI"/></forecast_information><current_conditions><condition data="’«›Ú"/><temp_f data="97"/><temp_c data="36"/><humidity data="«·—ÿÊ»…: &#x662;&#x662;&#x66A;"/><icon data="/ig/images/weather/sunny.gif"/><wind_condition data="«·—Ì«Õ: Éʻ »”—⁄… 8 fl„/”«⁄…"/></current_conditions><forecast_conditions><day_of_week data="«·√—»⁄«¡"/><low data="23"/><high data="37"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="„‘„” ›Ì √€·» «·√Êfi« "/></forecast_conditions><forecast_conditions><day_of_week data="«·Œ„Ì”"/><low data="20"/><high data="35"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="„‘„” ›Ì √€·» «·√Êfi« "/></forecast_conditions><forecast_conditions><day_of_week data="«·Ã„⁄…"/><low data="18"/><high data="33"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="„‘„” ›Ì √€·» «·√Êfi« "/></forecast_conditions><forecast_conditions><day_of_week data="«·”» "/><low data="19"/><high data="33"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="„‘„” ›Ì √€·» «·√Êfi« "/></forecast_conditions></weather></xml_api_reply>

Of course, I got error from NSXMLParser:

Error Domain=NSXMLParserErrorDomain Code=9 “The operation couldn’t be
completed. (NSXMLParserErrorDomain error 9.)”

That means the xml data is corrupted.

If I change the link from Google to be:

http://www.google.com/ig/api?weather=,,,21429730,39828370&hl=en

(notice english language now), all things works correctly..

I tried to encode the retrieved Arabic XML data by:

NSString * encodedString = [[NSString alloc] initWithBytes:recievedData.bytes length:recievedData.length encoding:NSStringEncodingConversionAllowLossy];

and then I putted the content in the file by:

[[NSFileManager defaultManager] createFileAtPath:filePath contents:[encodedString dataUsingEncoding:NSUTF8StringEncoding] attributes:nil];

the content now is better but it is still wrong, the content now :

<?xml version="1.0"?><xml_api_reply version="1"><weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0" ><forecast_information><city data=""/><postal_code data=""/><latitude_e6 data="21429730"/><longitude_e6 data="39828370"/><forecast_date data="2012-03-14"/><current_date_time data="2012-03-14 17:00:00 +0000"/><unit_system data="SI"/></forecast_information><current_conditions><condition data="ÕÇÝò"/><temp_f data="97"/><temp_c data="36"/><humidity data="ÇáÑØæÈÉ: &#x662;&#x662;&#x66A;"/><icon data="/ig/images/weather/sunny.gif"/><wind_condition data="ÇáÑíÇÍ: ÌäæÈ ÈÓÑÚÉ 8 ßã/ÓÇÚÉ"/></current_conditions><forecast_conditions><day_of_week data="ÇáÃÑÈÚÇÁ"/><low data="23"/><high data="37"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="ãÔãÓ Ýí ÃÛáÈ ÇáÃæÞÇÊ"/></forecast_conditions><forecast_conditions><day_of_week data="ÇáÎãíÓ"/><low data="20"/><high data="35"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="ãÔãÓ Ýí ÃÛáÈ ÇáÃæÞÇÊ"/></forecast_conditions><forecast_conditions><day_of_week data="ÇáÌãÚÉ"/><low data="18"/><high data="33"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="ãÔãÓ Ýí ÃÛáÈ ÇáÃæÞÇÊ"/></forecast_conditions><forecast_conditions><day_of_week data="ÇáÓÈÊ"/><low data="19"/><high data="33"/><icon data="/ig/images/weather/mostly_sunny.gif"/><condition data="ãÔãÓ Ýí ÃÛáÈ ÇáÃæÞÇÊ"/></forecast_conditions></weather></xml_api_reply>

The NSXMLParser doesn’t give me error now but the text results in not readable.

Sorry for this large question.

Can any one help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T14:06:26+00:00Added an answer on May 31, 2026 at 2:06 pm

    Add [oe=char_set] parameter to google url as follow:

    `http://www.google.com/ig/api?weather=Cairo,Egypt&hl=ar&oe=utf-8`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this link: http://www.google.com/maps?cid=0,0,612446611849848549&f=q&source=embed&hl=en&geocode=&q=Универзална+Сала+&sll=,&&ie=UTF8&hq=&hnear=Универзална+Сала+&ll=,&z=15&iwloc=near What I want is to retrieve the Lat Lng
I have tried this example http://www.bennadel.com/blog/1056-ColdFusion-CFPOP-My-First-Look.htm , but it retrieve emails from POP server.
I'm trying to retrieve some XML from the Gmail API. I have this so
I'm trying to retrieve files from sharepoint via SSRS and an XML Datasource. This
Here I tried to retrieve image from Url Connection , but i m not
I tried several ways to retrieve datetime2(3) equivalent from C# code but in vain.
I need to get(retrieve) updated cell value in controller. (MVC) So I tried this,
So I am trying to retrieve data from an XML stream coming from a
From my backend I retrieve a string that contains some xml data. When i
in my GWT web application, i am to retrieve XML data from the SOAP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.