Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfscript>
- // Just a new line.
- x="
- ";
- // This shows only chr(10) for both Lucee and ACF
- writeoutput( "pre-serialize char: ") ;
- for ( j=1;j<=len(x);j++) {
- writeoutput( x.right(j).asc() & " " ) ;
- }
- writeoutput("<br>");
- // Serialize x to JSON
- y=serializeJSON(x);
- // Which gives us:
- writeoutput("serialized= " & y & "<br>");
- //Now deserialize to see what characters are there:
- z = deserializeJSON(y) ;
- // What characters are there?
- writeoutput( "post-serialize char: " ) ;
- for ( i=1;i<=len(z);i++) {
- writeoutput( z.right(i).asc() & " " ) ;
- }
- /* LUCEE 5
- pre-serialize char: 10 13
- serialized= "\r\n"
- post-serialize char: 10 13
- */
- /* ACF 11+
- pre-serialize char: 10
- serialized= "\n"
- post-serialize char: 10
- */
- /*
- Lucee: newLine() == \n
- */
- </cfscript>
Add Comment
Please, Sign In to add comment