diff --git a/src/RestJsonUtils.pas b/src/RestJsonUtils.pas index f46a587..75c6863 100644 --- a/src/RestJsonUtils.pas +++ b/src/RestJsonUtils.pas @@ -30,7 +30,7 @@ TJsonUtil = class function JavaToDelphiDateTime(const dt: int64): TDateTime; function DelphiToJavaDateTime(const dt: TDateTime): int64; function ISO8601DateToJavaDateTime(const str: String; var ms: Int64): Boolean; -function ISO8601DateToDelphiDateTime(const str: string; var dt: TDateTime): Boolean; +function ISO8601DateToDelphiDateTime(const str: String; var dt: TDateTime): Boolean; function DelphiDateTimeToISO8601Date(dt: TDateTime): string; implementation @@ -356,9 +356,11 @@ TDateTimeInfo = record {$IFNDEF UNICODE} PSOChar = PWideChar; SOChar = WideChar; + SOString = WideString; {$ELSE} SOChar = Char; PSOChar = PChar; + SOString = String; {$ENDIF} var @@ -383,7 +385,7 @@ TDateTimeInfo = record label error; begin - p := PSOChar(str); + p := PSOChar(SOString(str)); sep := perhaps; state := stStart; pos := 0; @@ -968,7 +970,7 @@ TDateTimeInfo = record Result := False; end; -function ISO8601DateToDelphiDateTime(const str: string; var dt: TDateTime): Boolean; +function ISO8601DateToDelphiDateTime(const str: String; var dt: TDateTime): Boolean; var ms: Int64; begin