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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:49:55+00:00 2026-06-10T09:49:55+00:00

I have a string returned from the server. It is of the format, [{text:content}]

  • 0

I have a string returned from the server. It is of the format,

[{"text":"content"}]

where content is a dynamic string and will vary based on user actions. In one such particular case, the returned string cannot be eval’ed, but when I use JSON.parse, it works fine without issues. My eval is like below

eval("(" + response + ")").

Due to certain restrictions I cannot paste the problematic string here. But are there any particular cases where eval will not work and JSON.parse will work?

EDIT1 :
I narrowed down the problem and the particular string which gives the problem is,

[{"con" :"g
<\/font><\/td"}]

This string cannot be eval’ed but can by parsed.
I guess the issue is because of the sting”/”. But I am not able to understand why. Any help in this regard will be great.

EDIT2:
There exists an invisible character between g and < and that is causing the issue. Does anyone know what character it is?
I will be changing the eval to JSON.parse. But I wanted to know the reason why it failed.

  • 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-10T09:49:57+00:00Added an answer on June 10, 2026 at 9:49 am

    That buggy character is U+8232, the Unicode LINE SEPARATOR. It leads to “unterminated string literal” syntax errors in various browsers, this is why it does not work to eval() the string. JSON.parse can work around that, as JSON is not really a JS subset in that perspective.

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

Sidebar

Related Questions

Say I have the following JSON string returned from server: { response:{ imageInstances:{ one:{
I have a string returned from server with encoded HTML tags. I use the
I have dynamically created a xml string form a JSON object returned from server.
I have an JSON string that gets returned from the server that i'm trying
I have a string value that is returned from the database. the value will
I have a string being returned from my database that I want to use
I have a C# string RIP-1234-STOP\0\0\0\b\0\0\0???|B?Mp?\0\0\0 returned from a call to a native driver.
If I have the value 0.0042 returned and I pass this to: string.Format({0:C},....); It
I have a JSON object returned from server. It looks like this : {1:{id:1,name:autos},
I am using c# and modifying the HttpResponse returned from the server. I have

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.