coldfusion - JSON doesn't seem to like '4D ' -


this question has answer here:

i'm running strange issue in coldfusion using serializejson , deserializejson functions. when following:

<cfdump var="#deserializejson(serializejson('4d '))#"> 

and load page, error reads 'json parsing failure @ character 2:'d' in 4d'. when change d input looks '4e ' page loads fine, when change number input reads '5d ' same error. think may accidentally entering escape character don't know enough character encoding confidence. have idea why might happen?

it appears using coldfusion 9.x issue has been fixed in later versions of coldfusion.

this same issue has been asked before, please see coldfusion json serialization inconsistency

any entirely numeric string trailing d or f followed whitespace [..results in error when deserialized].

json parsing failure @ character 9:'d' in {"wtf":4d } 

the parser trims , checks if last character d or f (double or float) , strips it. if remaining characters numeric, no quotes added. if don't have trailing whitespace, works perfectly. specific combo of number, d|f , spaces trips up.


Comments