日本語 English

Deserialize

A function that converts JSON strings into a Dictionary structure. It supports nested objects, arrays and UTF-8 strings.

Overview

Sets a JSON string into a Dictionary structure

Symbols

Deserialize

Convert JSON to a Dictionary

Deserialize function
Input
In
BYTE[65535]
JSON string
In-out
dic
SimpleJSON\sDictionary
Dictionary

Conversion examples

Example 1

JSON

Directory
KeyValue
squadName "Super hero squad"
homeTown "Metro City"
formed 2016
secretBase "Super tower"
active true
members [{$"name$":$"MoleculeMan$", $"age$":29, $"secretIdentity$":$"DanJukes$", $"powers$":[$"Radiationresistance$", $"Turningtiny$", $"Radiationblast$"]}, {$"name$":$"MadameUppercut$", $"age$":39, $"secretIdentity$":$"JaneWilson$", $"powers$":[$"Milliontonnepnch$", $"Damageresistance$", $"Superhumanreflexes$"]}, {$"name$":$"EternalFlame$", $"age$":1000000, $"secretIdentity$":$"Unknown$", $"powers$":[$"Immortality$", $"HeatImmunity$", $"Inferno$", $"Teleportation$", $"Interdimensionaltravel$"]}]

Example 2 (JSON with nested objects)

JSON

Directory
Key Value
image.width 800
image.height 600
image.Title "View from 15th Floor"
image.Thumbnail.Url "http://www.example.com"
image.Thumbnail.Height 125
image.Thumbnail.Width 100
image.IDs [116,943, 234, 38793]
image2.width 100
image2.height 200
image2.Title "View from 16th Floor"
image2.Thumbnail.Url "http://www.example.com"
image2.Thumbnail.Height 25
image2.Thumbnail.Width 10
image2.IDs [16,93, 24, 3793]

Example 3 (JSON containing kanji)

JSON

Directory
Key Value
image.幅 800
image.高さ 600
image.Title "15階からの景観"
image.Thumbnail.Url "http://www.example.com"
image.Thumbnail.Height 125
image.Thumbnail.Width 100
image.IDs [116,943, 234, 38793]

FAQ

Can nested JSON be converted?

Yes. Nested objects are expanded into keys such as "image.Thumbnail.Url".

Can UTF-8 Japanese be handled?

Yes. JSON strings containing kanji can also be converted to a Dictionary.

Related pages

Comments