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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:37:54+00:00 2026-06-04T22:37:54+00:00

I need to write the equivalent to this php code json_encode(utf8_encode()) in objective-c I’ve

  • 0

I need to write the equivalent to this php code

json_encode(utf8_encode())

in objective-c

I’ve implemented the equivalent to utf8_encode with

[NSString stringWithCString:[testString cStringUsingEncoding:NSUTF8StringEncoding] encoding:NSASCIIStringEncoding]

So now, I need to implement the equivalent to json_encode php function.

input : “http://www.mydomain.com/s?c=Théâtre,Cinéma”

expected output :  “http://www.mydomain.com/s?c=Th\u00c3\u00a9\u00c3\u00a2tre,Cin\u00c3\u00a9ma”

Does anyone have an efficient way to do that?

  • 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-04T22:37:56+00:00Added an answer on June 4, 2026 at 10:37 pm

    You could have a look at

    + (NSData *)dataWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error
    

    You get back JSON data from some object of Apples Foundation classes. If you need a string, you could use:

    - (id)initWithData:(NSData *)data encoding:(NSStringEncoding)encoding
    

    of NSString. Might result in something like:

    NSString *string = [[[NSString alloc] initWithData:[NSJSONSerialization dataWithJSONObject:YOUR_OBJECT_HERE options:0 error:nil] encoding:NSUTF8StringEncoding] autorelease];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write this IronPython code in C# (I couldn't find a similar
I need to write some code to trigger internet connectivity on a computer. By
I need to write a delegate function that can 'wrap' some while/try/catch code around
I need to write a method which takes any object and returns an equivalent
I need to write, in JavaScript (I am using jQuery), a function that is
I need to write a small console app (patch) that turns off the print
I need to write a shell script to be scheduled to run daily to
I need to write an app that reads a config file with info on
I need to write a large amount of data in my application. Data arrive
I need to write a python script that makes multiple HTTP requests to the

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.