You are not logged in.
Hello,
I am converting some of my (old) code to use DocVariant as a JSON implementation.
But by including SynCommons in uses the compiler generated several explicit conversion warnings from / to string.
Due to SynCommons reintroducing various methods like Trim, etc. that uses RawUTF8.
function OneFunction (AString : String) : String;
begin
Result := Trim(AString); //This generate a warning since SynCommons.Trim expects RawUTF8
end;
I would not want to change everything to RawUTF8.
Some options I think:
- Leave SynCommons as the first uses unit. So that SysUtils, etc. override these functions.
- Use RawByteString as parameters.
- Explicit name of a unit: SysUtils.Trim (...)
What would be the suggestion to better resolve these conflicts? Along with maintaining the best performance possible?
NOTE: This code is being compiled in Delphi 10.3 / FPC. I do not need Unicode compatibility with previous versions of Delphi.
Offline
Thanks.
I will go in this direction.
Offline
I wold prefer explicit form: SysUtils.Trim(...)
Offline
Thanks for the opinion.
And to write new SynCommons-dependent utility units as you usually do?
Uses RawUTF8 in all parameters?
Offline