On Fri, 13 May 2016, Graeme Geldenhuys wrote:

Hi,

Is TJSONboolean, and it’s internal BoolToStr(AValue, True) and
StrToBool() calls, affected by locale settings?

GetAsString is.


For example:
My locale is en_GB and I store a Boolean (True) value to a JSON file,
which results in a string value “True”. If I now read that JSON file on
a system with locale af_ZA (Afrikaans, or any other non-English language
for that matter) - would it still work?

Yes, because 'GetAsJSON' is not dependent on locale, but returns hardcoded
values.

function TJSONBoolean.GetAsJSON: TJSONStringType;
begin
  If FValue then
    Result:='true'
  else
    Result:='false';
end;


Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to