libjson-devel Mailing List for libjson
Brought to you by:
ninja9578
You can subscribe to this list here.
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: jebina e. <jeb...@ya...> - 2016-09-02 06:33:34
|
Hi
Is there any inputs here on this matter?Please help.
Thanksjake
From: jebina elsie <jeb...@ya...>
To: "lib...@li..." <lib...@li...>
Sent: Tuesday, 30 August 2016 4:07 PM
Subject: JSONStream - use of single - double quote in the value
hi Johnathan Wallace,
Thanks for your amazing library.
When using JSONStream::operator << function, to parse the input json,if it contains the a \" in between the string say here is the example
{"name":"Test\"Quote"}it gives error saying its not proper json.
But the other hand, it parses correctly if its having two double quotes{"name":"Test\"Qu\"ote"}passes perfectly
Proposal: buffer = JSONWorker::RemoveWhiteSpaceAndComments(buffer, true); to be inserted in the function (JSONStream::parse) solves this issue.Any comments, and is there any patch planned for this issues
ThanksJake
void JSONStream::parse(void) json_throws(std::invalid_argument) { #ifdef JSON_SECURITY_MAX_STREAM_OBJECTS size_t objects = 0; #endif buffer = JSONWorker::RemoveWhiteSpaceAndComments(buffer, true); for(;;){ size_t pos = buffer.find_first_of(JSON_TEXT("{[")); if (json_likely(pos != json_string::npos)){ size_t end = (buffer[pos] == JSON_TEXT('[')) ? STREAM_FIND_NEXT_RELEVANT(JSON_TEXT(']'), buffer, pos + 1) : STREAM_FIND_NEXT_RELEVANT(JSON_TEXT('}'), buffer, pos + 1); if (end != json_string::npos){ #ifdef JSON_SECURITY_MAX_STREAM_OBJECTS if (++objects > JSON_SECURITY_MAX_STREAM_OBJECTS){ JSON_FAIL(JSON_TEXT("Maximum number of json objects for a stream at once has been reached")); if (err_call) err_call(getIdentifier()); state = false; return; } #endif START_MEM_SCOPE JSONNode temp(JSONWorker::parse(buffer.substr(pos, end - pos + 1))); #ifndef JSON_LIBRARY call(temp, getIdentifier()); #else call(&temp, getIdentifier()); #endif END_MEM_SCOPE json_string::iterator beginning = buffer.begin(); buffer.erase(beginning, beginning + end); continue; //parse(); //parse the next object too } #ifdef JSON_SAFE else { //verify that what's in there is at least valid so far #ifndef JSON_VALIDATE #error In order to use safe mode and streams, JSON_VALIDATE needs to be defined #endif json_auto<json_char> s; size_t len; s.set(JSONWorker::RemoveWhiteSpace(json_string(buffer.c_str() + pos), len, false)); if (!JSONValidator::isValidPartialRoot(s.ptr)){ if (err_call) err_call(getIdentifier()); state = false; } } #endif } break; }}
|
|
From: jebina e. <jeb...@ya...> - 2016-08-30 10:37:34
|
hi Johnathan Wallace,
Thanks for your amazing library.
When using JSONStream::operator << function, to parse the input json,if it contains the a \" in between the string say here is the example
{"name":"Test\"Quote"}it gives error saying its not proper json.
But the other hand, it parses correctly if its having two double quotes{"name":"Test\"Qu\"ote"}passes perfectly
Proposal: buffer = JSONWorker::RemoveWhiteSpaceAndComments(buffer, true); to be inserted in the function (JSONStream::parse) solves this issue.Any comments, and is there any patch planned for this issues
ThanksJake
void JSONStream::parse(void) json_throws(std::invalid_argument) { #ifdef JSON_SECURITY_MAX_STREAM_OBJECTS size_t objects = 0; #endif buffer = JSONWorker::RemoveWhiteSpaceAndComments(buffer, true); for(;;){ size_t pos = buffer.find_first_of(JSON_TEXT("{[")); if (json_likely(pos != json_string::npos)){ size_t end = (buffer[pos] == JSON_TEXT('[')) ? STREAM_FIND_NEXT_RELEVANT(JSON_TEXT(']'), buffer, pos + 1) : STREAM_FIND_NEXT_RELEVANT(JSON_TEXT('}'), buffer, pos + 1); if (end != json_string::npos){ #ifdef JSON_SECURITY_MAX_STREAM_OBJECTS if (++objects > JSON_SECURITY_MAX_STREAM_OBJECTS){ JSON_FAIL(JSON_TEXT("Maximum number of json objects for a stream at once has been reached")); if (err_call) err_call(getIdentifier()); state = false; return; } #endif START_MEM_SCOPE JSONNode temp(JSONWorker::parse(buffer.substr(pos, end - pos + 1))); #ifndef JSON_LIBRARY call(temp, getIdentifier()); #else call(&temp, getIdentifier()); #endif END_MEM_SCOPE json_string::iterator beginning = buffer.begin(); buffer.erase(beginning, beginning + end); continue; //parse(); //parse the next object too } #ifdef JSON_SAFE else { //verify that what's in there is at least valid so far #ifndef JSON_VALIDATE #error In order to use safe mode and streams, JSON_VALIDATE needs to be defined #endif json_auto<json_char> s; size_t len; s.set(JSONWorker::RemoveWhiteSpace(json_string(buffer.c_str() + pos), len, false)); if (!JSONValidator::isValidPartialRoot(s.ptr)){ if (err_call) err_call(getIdentifier()); state = false; } } #endif } break; }}
|
|
From: Paula S. <pau...@gm...> - 2014-09-22 16:09:05
|
Hello, I noticed that conversion from double or float to string is not done in an locate independent manner. So for example if I have the locale set to Germany a double value will be converted to a string using comma and not the decimal dot( "1,235") and according to the json standards this is not a valid double representation. Is this a known issue/ was this the intended behaviour ? I have a patch that fixes this issue but it's not clear how I can submit it. Can anyone provide some info on this? Best regards, Paula |
|
From: Sphoorti J. <sph...@gm...> - 2014-01-19 15:11:23
|
Hey Folks, I wrote a sample code to parse JSON string. Here is the link to it. http://pastebin.com/uZsWcsYc I also have commented the JSON_LIBRARY in JSONOptions.h However, I get the following error on running g++ trial.cpp from terminal: http://pastebin.com/kgWn3mpS My question is where must I be going wrong? Do I need to include any additional headers? Regards, Sphoorti |
|
From: Onslauth <ons...@gm...> - 2011-08-08 22:11:40
|
Hi. I have built libjson on VS 2010. And I have had no problems. I have also set the optional compile time value of /MT to enable multi threading cause my current project is built with that option. Now everything seems to be fine, I can build my project with libjson linked in, and it compiles, until I try to use any functions from libjson. Then I get the following errors: 1> statLibJson.lib(libjson.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance 1>LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification 1>statLibJson.lib(libjson.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSONChildren.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSONWorker.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSONValidator.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(internalJSONNode.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSONWriter.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSONIterators.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSONNode.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSONStream.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSONDebug.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj 1>statLibJson.lib(JSON_Base64.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in config.obj I have looked up the error and found the following entry on stackoverflow.com: http://stackoverflow.com/questions/4917592/compiling-and-using-jsoncpp-on-visual-studio10-with-boost It seems to suggest that its and issue with the setting of /MT, however I have rebuilt libjson with the value as specified and I still get the same issue. The code and all the options are the standard as provided in 7.3.1. I have not modified anything except removing the deprecated option cause of a compile issue in Visual Studio 2010. Does anyone have any idea what I can try, anything at all will be helpful. Thanks /Cole |