Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Coldfusion Decerialize

Posted on 2014-03-24
2
Medium Priority
?
249 Views
Last Modified: 2014-03-25
I decerialize the CF structures. and it works just fine. Now I am decerializing the the string but structure works and the other one does not. I am getting an error message

JSON parsing failure at character 4:'R' in "{"RUBRICTITLE":"test rubric22","OBSERVESELF":1,"INPERSON":0,"USENOTOBSERVED":1,"TRIGGERDAYS":0,"FIXEDDUEDATE":"","REPEATPERIOD":0,"DUEDATERULE":0,"ASSIGNMENTNAME":"msg test 1 - self","MAXPOINTS":3,"ASSIGNMENTTYPE":0,"ANONYMOUS":0,"RUBRICASSIGNMENTID":47}"
0
Comment
Question by:erikTsomik
2 Comments
 
LVL 52

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 39951186
If that's your real JSON string, it's because the string is enclosed in double quotes, so it's not valid JSON.

(quote){"RUBRICTITLE":"test rubric22",.... ,"RUBRICASSIGNMENTID":47}(quote)

Remove them and it will parse correctly:

<cfsavecontent variable="text">{"RUBRICTITLE":"test rubric22","OBSERVESELF":1,"INPERSON":0,"USENOTOBSERVED":1,"TRIGGERDAYS":0,"FIXEDDUEDATE":"","REPEATPERIOD":0,"DUEDATERULE":0,"ASSIGNMENTNAME":"msg test 1 - self","MAXPOINTS":3,"ASSIGNMENTTYPE":0,"ANONYMOUS":0,"RUBRICASSIGNMENTID":47}</cfsavecontent>
<cfdump var="#deserializeJSON(text)#">
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 39952324
Check your json string with json parser:

http://jsonlint.com/

Just checked, This is your valid JSON Format:

{
    "RUBRICTITLE": "test rubric22",
    "OBSERVESELF": 1,
    "INPERSON": 0,
    "USENOTOBSERVED": 1,
    "TRIGGERDAYS": 0,
    "FIXEDDUEDATE": "",
    "REPEATPERIOD": 0,
    "DUEDATERULE": 0,
    "ASSIGNMENTNAME": "msg test 1 - self",
    "MAXPOINTS": 3,
    "ASSIGNMENTTYPE": 0,
    "ANONYMOUS": 0,
    "RUBRICASSIGNMENTID": 47
}

Open in new window


Just remove quotes from the start and the end
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
What You Need to Know when Searching for a Webhost Provider
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question