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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:26:36+00:00 2026-06-15T09:26:36+00:00

I am inserting HTML content (which has special characters like bullets, etc) into the

  • 0

I am inserting HTML content (which has special characters like bullets, etc) into the SQLite database.

When I try to get the content on a view, it does not show the special characters correctly. It shows me junk text.

How can I ensure that whatever text I insert in database, it is displayed correctly on the view.

Thanks!

My Insertion code:

// This query method implementation is in different file

- (NSArray *)executeQuery:(NSString *)sql arguments:(NSArray *)args {
    sqlite3_stmt *sqlStmt;

    if (![self prepareSql:sql inStatament:(&sqlStmt)])
        return nil;

    int i = 0;
    int queryParamCount = sqlite3_bind_parameter_count(sqlStmt);
    while (i++ < queryParamCount)
        [self bindObject:[args objectAtIndex:(i - 1)] toColumn:i inStatament:sqlStmt];

    NSMutableArray *arrayList = [[NSMutableArray alloc] init];   // By Devang
    int columnCount = sqlite3_column_count(sqlStmt);
    while ([self hasData:sqlStmt]) {
        NSMutableDictionary *dictionary = [[NSMutableDictionary alloc] init];
        for (i = 0; i < columnCount; ++i) {
            id columnName = [self columnName:sqlStmt columnIndex:i];
            id columnData = [self columnData:sqlStmt columnIndex:i];
            [dictionary setObject:columnData forKey:columnName];
        }
        [arrayList addObject:dictionary];

        //[arrayList addObject:[dictionary autorelease]];
    }

    sqlite3_finalize(sqlStmt);

    return arrayList;
}

// now call this method by make object for this file

NSString *inserQuery =[NSString stringWithFormat:@"insert into feedtest (title,summary,image,id) values ('%@','%@','%@',%d)",cell.textLabel.text,source,returnURL,indexPath.row];
        NSLog(@"query - %@",inserQuery);

    [database executeQuery:inserQuery];

// Retrive the data

NSString *sd=[NSString stringWithFormat:@"Select title,summary from feedtest"];

    NSMutableArray *p=[[NSMutableArray alloc]init];
    p=[[database executeQuery:sd ] mutableCopy];
    [database close];

    NSString *titleHTML = [[p objectAtIndex:i]valueForKey:@"title"];
    NSString *postHTML =[[p objectAtIndex:i]valueForKey:@"summary"];
    NSLog(@"%@",titleHTML);
    NSLog(@"%@",postHTML);
  • 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-15T09:26:37+00:00Added an answer on June 15, 2026 at 9:26 am

    You can check your local database using FireFox plugin SQLite. But, sometimes on retrieving we faced strange problem like what is present in the storage not coming properly and sometime, there is crash. So my suggestion is what you should check encoding scheme(normally, it’s not matter more) and while getting data use this:

    [NSString stringWithFormat:@"%s",(const char*)sqlite3_column_text(statement, 4)] ;
    

    instead of:

    [NSString stringWithUTF8String:(const char*)sqlite3_column_text(statement, 4)];
    

    Hope, this is what you’re looking for. Any concern get back to me. 🙂

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

Sidebar

Related Questions

When inserting copy into an HTML document I get from sources such as word
I have a database, which has a table with fields like title, album, artist...
I am inserting data into a table which contains some basic html tags, double
I have a <select> drop down that I'm inserting into my HTML via jQuery.
Currently I have some xml documents which are converted via xsl into html. The
I am writing a script to insert presaved html content into Gmail's editable iframe
I have multiple html files, which is to be combined into a single html
After inserting new html to DOM,I need to add some listeners to it. But
How can we write html tidy coding only for inserting closing tag in the
I am using HTML 5 to develop a few things and inserting Facebook JavaScript

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.