我有一个像这样的 JSON:
\n{\n"Content": [{\n "Identifier": "AABBCC",\n "Description": "test terfdfg",\n "GenericProductIdentifier": "AABBCC",\n "ProductFamilyDescription": "sampling",\n "LifeCycleStatus": "ACTIVE",\n "Price": {\n "Value": 1.00,\n "Quantity": 1000\n },\n "LeadTimeWeeks": "16",\n "FullBoxQty": 200,\n}],\n"TotalElements": 1,\n"TotalPages": 1,\n"NumberOfElements": 1,\n"First": true,\n"Size": 1,\n"Number": 0\n}\nRun Code Online (Sandbox Code Playgroud)\n在 Delphi 10.4 中,我尝试解析它,但无法访问 \'Price\' 中包含的值 \xe2\x80\x8b\xe2\x80\x8b。
\n我写了这样的代码:
\nvar\n vContent: TJSONArray;\n vJson: TJSONObject;\n vContentRow: TJSONObject;\n i,j : Integer;\nbegin\n Memo2.Lines.Clear;\n\n if Memo1.Text = \'\' then\n exit;\n\n vJson := TJSONObject(TJSONObject.ParseJSONValue(TEncoding.ASCII.GetBytes(Memo1.Text),0));\n try\n vContent := TJSONArray(vJson.Get(\'Content\').JsonValue);\n\n for i := 0 to Pred(vContent.Count) do\n begin\n vContentRow := TJSONObject(vContent.Items[i]);\n for …Run Code Online (Sandbox Code Playgroud)