Cfserialize (Coldfusion) erroneously outputting JSON data as numeric
Posted on 2012-04-02
I'm using the cfserialize command in Coldfusion to output some data into JSON format. In the developer edition of CF it works perfectly but in a hosted environment running enterprise it's not running correctly even though everything appears the same as far as version etc. So, what's happening is the data that is defined to be char or varchar in the database is being converted to numeric in SOME instances in the JSON output if the data itself is numeric.
Does anyone know of simple a solution to this?
I thought a regular expression might be the best way to go though I have very little experience with regular expressions. For my particular situation all it would have to do with the JSON is check to see if each item of data is quoted and, if it isn't, add quotes.
Any assistance would be greatly appreciated.