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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:05:01+00:00 2026-06-07T04:05:01+00:00

Trying to convert strings that contain an escaped unicode (ex: \u3400) in the range

  • 0

Trying to convert strings that contain an escaped unicode (ex: \u3400) in the range of U+20000 to U+2B81F to form URLs, but it’s not working. The range U+3400 to U+9FFF works just fine.

NSString *string1 = @"\u9FFF";
string1 = [string1 stringByReplacingPercentEscapesUsingEncoding:NSUnicodeStringEncoding];
NSURL *url1 = [NSURL URLWithString:[NSString stringWithFormat:@"http://en.wikipedia.org/Search?search=%@", string1]];
NSLog(@"url1: %@", url1);

OUTPUT: url1: http://en.wikipedia.org/Search?search=%E9%BF%BF

NSString *string2 = @"\u20000";
string2 = [string2 stringByReplacingPercentEscapesUsingEncoding:NSUnicodeStringEncoding];
NSURL *url2 = [NSURL URLWithString:[NSString stringWithFormat:@"http://en.wikipedia.org/Search?search=%@", string2]];
NSLog(@"url2: %@", url2);

OUTPUT: url2: (null)

Basically, what I want is to convert a list of escaped unicodes (\u3400 to \u2B81F) to URLs (or even NSStrings). If there is another way to achieve this by other string conversion means, I’ll be thankful.

  • 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-07T04:05:03+00:00Added an answer on June 7, 2026 at 4:05 am

    I don’t know why you’re trying to de-escape a Unicode char, when NSString is already UTF-8 encoded:

    EDIT: I’ve got it! It sure doesn’t NSLog() at all, but it ain’t (null), and that’s all that matters.

    const char * str = "\0xF0\0xA0\0x80\0x80";
    NSString *string2 = [NSString stringWithUTF8String:str];
    NSURL *url2 = [NSURL URLWithString:[NSString stringWithFormat:@"http://en.wikipedia.org/Search?search=%@", string2]];
    NSLog(@"url2: %@", string2);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to convert Strings of user input into int. No problem with that,
I am trying to convert a string that is 8 characters long of hex
I'm trying to convert a string that I'm reading from a file to lowercase
I'm trying to retrieve odd values in a List of strings and convert them
I am trying to convert a Linq query that I have working in Linq
I'm trying to build a python procedure that: Open a .txt file (which contain
I am trying to convert my shell scripts into python code, but I am
I have two lists containing unicode strings. I'm trying to remove every element from
Im trying to convert a general tree (tree that have one or more children
Just to clarify something first. I am not trying to convert a byte array

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.