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 9205151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:53:05+00:00 2026-06-17T23:53:05+00:00

I have a problem with encoding when parsing web page with hpple in XCode.

  • 0

I have a problem with encoding when parsing web page with hpple in XCode.

- (void)loadTutorials {

NSURL *tutorialsUrl = [NSURL URLWithString:@"http://qrz.si/members/s55db/"];
NSData *tutorialsHtmlData = [NSData dataWithContentsOfURL:tutorialsUrl options:NSASCIIStringEncoding error:nil];


TFHpple *tutorialsParser = [TFHpple hppleWithHTMLData:tutorialsHtmlData];

NSString *tutorialsXpathQueryString = @"//td[@class='data']";
NSArray *tutorialsNodes = [tutorialsParsersearchWithXPathQuery:tutorialsXpathQueryString];


NSMutableArray *newTutorials = [[NSMutableArray alloc] initWithCapacity:0];
for (TFHppleElement *element in tutorialsNodes) {
    Tutorial *tutorial = [[Tutorial alloc] init];
    [newTutorials addObject:tutorial];


    for (TFHppleElement *child in element.children) {
        if ([child.tagName isEqualToString:@"img"]) {
           // NSLog([child objectForKey:@"src"]);
        } else if ([child.tagName isEqualToString:@"p"]) {
            //NSLog([[child firstChild] content]);
            tutorial.title = [[child firstChild] content];
        }
    }
}

_objects = newTutorials;
[self.tableView reloadData];
}

Page should be UTF-8 as the source points out, but I get wierd characters out.

How can I force change encoding of the data? Any help would be highly appreciated!

  • 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-06-17T23:53:06+00:00Added an answer on June 17, 2026 at 11:53 pm
    options:NSASCIIStringEncoding
    

    is useless here, documentation points out that it’s not the right way to go.

    To set encoding, one must edit XPathQuery.m by Matt Gallagher, that I got in the same tutorial. Changes were visible, but nothing worked, as the site was clearly UTF-8 encoded.

    The problems were server side and administrator offered me good old plain XML 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with utf-8 encoding in primefaces 3. but with this (adding
I have a litle problem with my text encoding, when user filed textarea field
I am experiencing some problem on UTF-8 Encoding. I have a CSV file and
I have problem with http://abfoodpolicy.com/ . In IE 8 and 9 the right sidebar
I have an app that is parsing the html page and extracts some text
I have a strange problem. In PHP I want to communicate to a Web
I have a problem parsing an xml, actually transforming it. The error I get
I'm parsing HTML code in url var, but I have an strange problem with
In a legacy MFC CHttpServer based web server, we have a command parsing map
I have a problem with parsing a JSON result. This is what I get

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.