rpgmaker / NetJSON

Faster than Any Binary? Benchmark: http://theburningmonk.com/2014/08/json-serializers-benchmarks-updated-2/
MIT License
231 stars 29 forks source link

Bad indent using prettify #147

Closed npoy closed 7 years ago

npoy commented 7 years ago

Hi, triying to indent my json i used the NETJsonSetting "NetJSONFormat.Prettify" but that destroys my jsonFile when serialize an specific string value:

String value: "Data Source=[DataSource,];Initial Catalog=[Database,];User ID=[User,];Password=[Password,];Trusted_Connection=[TrustedConnection,False]"

Image before: image

Image after: image

I think that is an error because i had to use other solution to indent my json after the serialization..

Ty, bye!

rpgmaker commented 7 years ago

The reason it got indented is because of your []. It thinks that they are arrays. If you remove the brackets, it should work properly.

Thanks,

npoy commented 7 years ago

I think that is an error because the indenter function is trying to prettify a string. I had to use another tool to indent the json and it works fine. So, i think that remove [] is not a solution because it happens with {} and commas too.

Thanks,

rpgmaker commented 7 years ago

You are correct. I will try to remove the prettify from a regular string i guess.

rpgmaker commented 7 years ago

Did the changes helped? I have not updated the nuget package since it is too soon because I just updated it not too long ago. Wanted to wait for a major change first.

npoy commented 7 years ago

Thanks for your help man, its working now, I will wait for the nuget update but i can use your source for a while.

Ty Bye.