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

  • Home
  • SEARCH
  • 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 9128363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:29:49+00:00 2026-06-17T07:29:49+00:00

I am trying to convert a string into url but not getting success. any

  • 0

I am trying to convert a string into url but not getting success. any better way to do, or improve the below code. thanks

NSString *strURL = @"http://domain.com/This Is My, Code for This. app";
NSString *escapedUrlString = [strURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(escapedUrlString);

It is showing this log

http://domain.com/This2s2y,芙ode
0.000000or2his.20×1.55e800047f4p-1029pp

Here is my actual code sending and save data to mysql

NSString *data = @"This Is My, Code for This. app";
NSString *strURL = [NSString stringWithFormat:@"http://domain.com/connection.php?data=%@", data];   

NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];


NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];  

NSURL *urll = [NSURL URLWithString:strResult];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:urll];

[request setHTTPMethod:@"GET"];


NSURLResponse *response;
NSError *err;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSLog(@"responseData: %@", responseData);

No success with this, but when I use

data = @"ThisIsMyCode";

Then everything works fine…
Help

  • 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-17T07:29:50+00:00Added an answer on June 17, 2026 at 7:29 am
    NSString *data = @"This Is My, Code for This. app";
    NSString *escapedDataString = [data stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    NSString *strURL = [NSString stringWithFormat:@"http://domain.com/connection.php?data=%@", escapedDataString];
        NSLog(@"Encoded:%@",strURL);
    

    This works fine, this is the log:

    Encoded:http://domain.com/connection.php?data=This%20Is%20My,%20Code%20for%20This.%20app
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying To convert: 'any string separated with blankspaces' into 'any-string-separated-with-blankspaces' i am
I'm trying to send a string via ftp using the code below but I'm
I am trying to convert a Java function into equivalent Groovy code, but I
I am trying to convert a string value into a name of an attribute
I'm trying to convert the String \something\ into the String \\something\\ using replaceAll ,
I am trying to convert a HTML string into a .PNG file. Thanks to
i am trying to convert a LPCSTR string into LPCTSTR string. i want to
Trying to convert a string of binary inputs into a vector of ints. I'd
I'm trying to use std::ostringstream to convert a number into a string (char *),
I am trying to convert string to class name. My code is: app.actNum =

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.