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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:33:35+00:00 2026-05-20T20:33:35+00:00

Bit new to JSON so please excuse the simpleton question, but according to the

  • 0

Bit new to JSON so please excuse the simpleton question, but according to the list of special characters found here and here, single quote (‘) characters are meant to be escaped. The specification also treats solidus (/) as escapable character. To illustrate I’m using the documentation example (slightly modified).

input:

Product product = new Product();

product.Name = "O'Grady's Apples";
product.Expiry = new DateTime(2008, 12, 28);
product.Price = 3.99M;
product.Sizes = new string[] { "Small", "Medium", "Large", "X/Large" };

output = JsonConvert.SerializeObject(product, Formatting.Indented);

output:

{    
"Name": "O'Grady's Apples",  
"Expiry": "\/Date(1230422400000+0000)\/",
"Price": 3.99,
"Sizes": ["Small","Medium","Large", "X/Large"]
}

What I would expect to see is

{  
"Name": "O\'Grady\'s Apples",...  
"Sizes": ["Small","Medium","Large", "X\/Large"]  
}

Is this intended? Or am I misinterpreting the specifications?

  • 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-20T20:33:36+00:00Added an answer on May 20, 2026 at 8:33 pm

    While everything can be escaped inside a string, only a very limited set needs to be escaped:

    The representation of strings is similar to conventions used in the C
    family of programming languages. A string begins and ends with
    quotation marks. All Unicode characters may be placed within the
    quotation marks except for the characters that must be escaped:
    quotation mark, reverse solidus, and the control characters (U+0000
    through U+001F).

    So only ", \ and the unprintable control characters must be escaped.

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

Sidebar

Related Questions

I'm a bit new to Rails/RSpec/Capybara, so this is probably a newbie question, but
my question might be a bit confusing, but here is what i would like
I am new to json, js etc. So I am a bit confused about
I'm playing a little bit with the new StackOverflow API . Unfortunately, my JSON
Trying my way on a little bit of JSON here in my asp.net mvc
I'm not pretty sure if this question is for here, but I want to
I'm learning everyday a little bit more about android developing and json code. But
I am a bit new to d3.js, but I'm having quite a bit of
Bit of a vague question, but I'm unsure how I can this to work.
Please keep in mind that I'm rather new to how MVC, Json, jQuery, etc.

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.