Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected '\"' in middle of array #564

Closed
nickvkaam opened this issue Apr 19, 2017 · 3 comments
Closed

Unexpected '\"' in middle of array #564

nickvkaam opened this issue Apr 19, 2017 · 3 comments

Comments

@nickvkaam
Copy link

I'm trying to parse a string containing json, but it throws an error in the middle of an array of strings (it throws it at position 245). Any json lint tells me the json is correct.

{"a":["fRKEOtRT-etHJOG-lcpJs","MGCHDafQ-LPEXCa-pCeKa","VqjmMLkX-kUShAJ-mcVOp","yuGaeMEF-dVuIMc-TOVt","JdSUVsXx-WUwiIa-HMRH","BkOjJqiu-TKweln-bPFCi","GEkNLxVo-QnHWvT-IbHoc","uKBPcJvW-MOVVpM-kyHrA","iBAlBhsE-allRcH-uqVyK","LwegSOiP-rgUozo-KnoPs","JBxqhpmF-VLGdvg-cxGG¦","hFdrSaBY-eXmTXi-NxFnF","jBfFVOMr-OOceYr-HxsKD","WbQpuAjS-iuTQyq-ddblf","jcSMtECx-LuNWfK-amqw","FiRVJpCQ-MbCvVg-WerPS","TTSDDSpI-slmIQR-frLlD","EGptPBVe-ISUDM0-lrKQO","HLImGoSu-EuxWNn-PPRum","nWUhJxjV-rTQRUy-aMWhe","TaqJPuWi-RMMJuN-xm0","ekLfFogT-STNktZ-XW0I","BDkNQNIG-AdswHQ-ulmdK","FKlKOVEP-IKJhd¦-eVMH","bKmsUMWp-JCqXtu-Hdhaw","emjvdmif-ITPENH-OytDK","FnrqvslC-WqVUXy-vcBAO","HSumNLLh-kLoqBT-TkuSS","wJBfCwwj-JKmjFa-WCSAc","tsOngmgX-jbEKHt-jvpUS","EbBRCEPs-QStfKn-AGZsM","JIhwKSGZ-TTmUgO-eJlT¦","vGeRUFPb-SXtdDP-hhbiJ","uhqsMroN-oleCps-xwboT","AnwMcNWw-aBtGsC-UPvSy"],"b":"VIbiLEW¦-nIlfGi-HQFW","c":["QFAkxppA-PcIvtc-MQdGQ"],"d":"Vwoweowjawe","e":"AEVsRDLK-obRNar-FrTn","f":"","g":0,"h":0}

Any idea what's going on? Any help is appreciated :)

Kind regards,

Nick

@nlohmann
Copy link
Owner

I cannot reproduce the error with the develop version. The following code runs without exception:

#include "json.hpp"

using json = nlohmann::json;

int main() {
    std::string s = R"({"a":["fRKEOtRT-etHJOG-lcpJs","MGCHDafQ-LPEXCa-pCeKa","VqjmMLkX-kUShAJ-mcVOp","yuGaeMEF-dVuIMc-TOVt","JdSUVsXx-WUwiIa-HMRH","BkOjJqiu-TKweln-bPFCi","GEkNLxVo-QnHWvT-IbHoc","uKBPcJvW-MOVVpM-kyHrA","iBAlBhsE-allRcH-uqVyK","LwegSOiP-rgUozo-KnoPs","JBxqhpmF-VLGdvg-cxGG¦","hFdrSaBY-eXmTXi-NxFnF","jBfFVOMr-OOceYr-HxsKD","WbQpuAjS-iuTQyq-ddblf","jcSMtECx-LuNWfK-amqw","FiRVJpCQ-MbCvVg-WerPS","TTSDDSpI-slmIQR-frLlD","EGptPBVe-ISUDM0-lrKQO","HLImGoSu-EuxWNn-PPRum","nWUhJxjV-rTQRUy-aMWhe","TaqJPuWi-RMMJuN-xm0","ekLfFogT-STNktZ-XW0I","BDkNQNIG-AdswHQ-ulmdK","FKlKOVEP-IKJhd¦-eVMH","bKmsUMWp-JCqXtu-Hdhaw","emjvdmif-ITPENH-OytDK","FnrqvslC-WqVUXy-vcBAO","HSumNLLh-kLoqBT-TkuSS","wJBfCwwj-JKmjFa-WCSAc","tsOngmgX-jbEKHt-jvpUS","EbBRCEPs-QStfKn-AGZsM","JIhwKSGZ-TTmUgO-eJlT¦","vGeRUFPb-SXtdDP-hhbiJ","uhqsMroN-oleCps-xwboT","AnwMcNWw-aBtGsC-UPvSy"],"b":"VIbiLEW¦-nIlfGi-HQFW","c":["QFAkxppA-PcIvtc-MQdGQ"],"d":"Vwoweowjawe","e":"AEVsRDLK-obRNar-FrTn","f":"","g":0,"h":0})";
    
    auto j = json::parse(s);
    std::cout << j << std::endl;
}

@nlohmann
Copy link
Owner

(The same holds true for the manual_lexer branch.)

@nickvkaam
Copy link
Author

Thank you for your quick reply! Copying the code gives me the same error. I'm using the current version of the library. My project is build in Visual Studio 2015 (v140). I will check my setup and close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants