Solved

Coldfusion Decerialize

Posted on 2014-03-24
2
228 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 500 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
need some regex help 15 29
Download a website to hdd 2 80
ajaxSubmit is giving me an error 1 47
Restore of mysql database from .SQL file - using Coldfusion 5 41
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 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