nlohmann/json

A lot of EOT in json file

erikpa1 opened this issue · 1 comments

Description

When I dump json I have a lot of EOT in my file, as you can see here:

I use json.dump(4, 4, true);

image

bug.simstudio.json

The problem is that, json serialized in this way by this library, is not deserializable by this library,... when i put .dump(0, 0, true), serialization works wery well. Also when I manualy remove EOT.

Here is almost the same file (UID are different, because, it UUID):

nobug.simstudio.json

Reproduction steps

My json is handled from software, where I serialize multiple entities,.. please try to bug.simstuido.json provided. Json is generated via this library, and I try to read it also with this library.

Or create your own multi hierarchical json using .dump(4, 4, true)

Expected vs. actual results

To not throw the error ?

Minimal code example

instance.dump(0, 0, true);

Error messages

[json.exception.parse_error.101] parse error at line 2, column 1: syntax error while parsing object key - invalid literal; last read: '{<U+000A><U+0004>'; expected string literal

Compiler and operating system

Windows, Visual Studio 2019

Library version

Downloaded a week ago ?

Validation

Nah sorry I'm idiot, for some reason the second paramater of .dump() is indent char, not a number (I have no idea why I even used number 4,... ) Anyway,... that was the mistake..

image