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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:36:39+00:00 2026-05-16T23:36:39+00:00

Code: NSString* string3 = (NSString*)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)tvQ.text, NULL, (CFStringRef)@:/?#[]@!$&'()*+,;=, kCFStringEncodingUTF8); My code is working to

  • 0

Code:

NSString* string3 = (NSString*)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)tvQ.text, NULL, (CFStringRef)@":/?#[]@!$&'()*+,;=", kCFStringEncodingUTF8);

My code is working to pass special characters properly via URL to my database, however, if I insert data with linebreaks, it seems to break my app and crashes. Any ideas?

**code was provided to me by user “tc.” from a previous question. This is a different issue, so I started a new question.

Figured out the answer:

NSString* encoded = [[string stringByReplacingOccurrencesOfString:@"\n" withString:@" "] stringByReplacingOccurrencesOfString:@"ç" withString:@"c"];
NSString* string3 = [(NSString*)CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)encoded, NULL, (CFStringRef)@":/?#[]@!$&'()*+,;=", kCFStringEncodingUTF8) autorelease];
  • 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-16T23:36:39+00:00Added an answer on May 16, 2026 at 11:36 pm

    maybe you should parse the string before calling CFURLCreateStringByAddingPercentEscapes…

    A good idea is probably to use NSMutableString’s method

    replaceOccurrencesOfString:withString:options:range:
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 533k
  • Answers 533k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Using SimpleDateFormat String format = "EE MMM dd HH:mm:ss zz… May 17, 2026 at 12:26 am
  • Editorial Team
    Editorial Team added an answer I assume that you have two (or more) seperate models… May 17, 2026 at 12:26 am
  • Editorial Team
    Editorial Team added an answer If you write an extension method, it will still have… May 17, 2026 at 12:26 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have this code -(IBAction) generateFlashNow:(id)sender{ [textField resignFirstResponder]; NSString *string1 = textField.text; //NSString *string2
Consider the following code NSString *param_string @1:3:6:10:15:22:28:30; NSArray *params = [param_string componentsSeparatedByString:@:]; NSNumberFormatter *formatter
I have this code NSString *tr = [self sendUrl:@http://google.com/]; But for some reason '
I want to compare the value of an NSString to the string Wrong. Here
I was just writing some exploratory code to solidify my understanding of Objective-C and
i've written a for loop in Objective-C, This is how my code looks like
I am trying to convert a standard std::string into an NSString but I'm not
I want to make a C char array from NSString object in Obj-C. My
This is really strange, I'm not sure what could be causing the code to
I have to POST data to a php page from an Iphone application, so

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.