unexpected character appear from method folly::toJson
Open
- Dominant language
- C++
- Stars
- 30.5k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Description
- recreate step :
```
#include
#include
#include
#include
int main()
{
std::string str = "dev's work";
std::string sign = "\'\\\'\'";
boost::replace_all(str, "'", sign);
std::cout << str << std::endl;
folly::dynamic itemValue = folly::dynamic::object("value", str);
auto target = folly::toJson(itemValue);
std::cout << target << std::endl;
return 0;
}
```
`g++ -g test.cpp -o test -I/path/include -L/path/lib -lfolly`
```
$ ./test
dev'\''s work
{"value":"dev'\\''s work"}
```
- expected :
`{"value":"dev'\''s work"}`
Contributor guide
Assessment
This issue has not been assessed yet.