Quantcast
Channel: VFPX
Viewing all articles
Browse latest Browse all 3798

Commented Unassigned: nfjson doesn't unescape special characters [43558]

$
0
0
Hi,

when I use nfjsoncreate special characters (like for example double quotes) are correctly escaped, so the output for the following code:

```
pair = CREATEOBJECT("empty")
addproperty(pair , "context", '"hello"')

json = nfjsoncreate(pair)
```

is correctly

```
{"context":"\"hello\""}
```

However if we take this output and try to rebuild the original object, the double quotes are not unescaped. To be more clear the output for the following code:

```
pair = CREATEOBJECT("empty")
addproperty(pair , "context", '"hello"')

json = nfjsoncreate(pair)

deserialobj = nfjsonread(json)
?nfjsoncreate(deserialobj)
```

is

```
{"context":"\\\"hello\\"}
```

Maybe there is a problem with function unescapecontrolc from nfjsonread?
Comments: ** Comment from web user: adelbene **

Hi,

I just noted one thing that looks weird to me, but maybe it's a problem with my VFP environment. As I said now everything works fine, but only if I compile my code to exe and run it. If instead I try to run my code from VFP I get the behaviour I told you in the last post ( it keeps the slash character: 'string \"with\" quote').
Was it meant to behave like this or (more likely) is a problem with my dev environment?

Thank you.


Viewing all articles
Browse latest Browse all 3798

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>