pocoproject/poco — pull request #533 by rafzi (2014-09-06 17:48:40+00:00)
Title: fix JSON stringify to escape special characters

When converting from non string types the converted string was not escaped

Here is an example / testcase that was fixed by this PR.

```
template
void PrintJSON(T&& v)
{
std::stringstream ss;
Poco::JSON::Array json;
json.add(std::forward(v));
json.stringify(ss);
std::cout << ss.str() << std::endl;
}

int main()
{
std::string teststr = "hello \\ world";
Poco::Dynamic::Array testvec{ teststr };

PrintJSON(teststr);
PrintJSON(testvec);
}
```

The code generated the following output. Notice that the second string is not valid JSON, because of the not escaped backslash.

```
["hello \\ world"]
[[ "hello \ world" ]]
```