#13 Setting Extended ASCII Codes in Delphi

open
nobody
None
5
2010-04-12
2010-04-12
No

I'm setting the value of an JSON-String in Delphi (the String contains the extended ASCII Code ü (129)). At this time the value is correct inside the JSON-Object. When I use the GenerateText-function the Result does not contain the right value.

parameter := TlkJSONobject.Create(false);
ids := TlkJSONlist.Create();
ids.Add('Flurstück');
parameter.Add('IDS', ids);
TlkJSON.GenerateText(parameter):

'{"IDS":["Flurstück"]}' would be expected.
'{"IDS":["Flurstück"]}' is returned.

The value is switched to the wrong value in the following line in GenerateText:
ws := UTF8Encode(TlkJSONstring(obj).FValue);

Discussion