diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-19 18:57:19 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-19 18:57:19 +0300 |
commit | 79d4eb2e8e57025219e6c5680a88446c0a047b8f (patch) | |
tree | 7f7046ffbe550f9f5b352c9b9f63426680cd40de /libs/libjson | |
parent | 1efaa4caed2e8e15a211e4821036658e90f47ca1 (diff) |
we don't escape apostrophes in json
Diffstat (limited to 'libs/libjson')
-rw-r--r-- | libs/libjson/src/JSONWorker.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/libs/libjson/src/JSONWorker.cpp b/libs/libjson/src/JSONWorker.cpp index 718f1c68aa..9a322742be 100644 --- a/libs/libjson/src/JSONWorker.cpp +++ b/libs/libjson/src/JSONWorker.cpp @@ -561,36 +561,33 @@ json_string JSONWorker::UnfixString(const json_string & value_t, bool flag){ const json_char * p = value_t.c_str();
while(*p){
switch(*p){
- case JSON_TEXT('\"'): //quote character
+ case JSON_TEXT('\"'): // quote character
res += JSON_TEXT("\\\"");
break;
- case JSON_TEXT('\t'): //tab character
+ case JSON_TEXT('\t'): // tab character
res += JSON_TEXT("\\t");
break;
- case JSON_TEXT('\n'): //newline character
+ case JSON_TEXT('\n'): // newline character
res += JSON_TEXT("\\n");
break;
- case JSON_TEXT('\r'): //return character
+ case JSON_TEXT('\r'): // return character
res += JSON_TEXT("\\r");
break;
- case JSON_TEXT('\\'): //backslash
+ case JSON_TEXT('\\'): // backslash
res += JSON_TEXT("\\\\");
break;
- case JSON_TEXT('/'): //forward slash
+ case JSON_TEXT('/'): // forward slash
res += JSON_TEXT("\\/");
break;
- case JSON_TEXT('\b'): //backspace
+ case JSON_TEXT('\b'): // backspace
res += JSON_TEXT("\\b");
break;
- case JSON_TEXT('\f'): //formfeed
+ case JSON_TEXT('\f'): // formfeed
res += JSON_TEXT("\\f");
break;
- case JSON_TEXT('\v'): //vertical tab
+ case JSON_TEXT('\v'): // vertical tab
res += JSON_TEXT("\\v");
break;
- case JSON_TEXT('\''): //apostrophe
- res += JSON_TEXT("\\\'");
- break;
default:
/*if (((json_uchar)(*p) < 32) || ((json_uchar)(*p) > 126)) {
//res += toUTF8((json_uchar)(*p));
|