[fpc-pascal] Weird string behavior

Santiago A. svaa at ciberpiula.net
Fri Jul 22 17:33:52 CEST 2016


El 22/07/2016 a las 15:03, Jonas Maebe escribió:
>
> See again
> http://wiki.freepascal.org/FPC_Unicode_support#String_concatenations
> (same as before).

So

  ResultA := AnsiToUTF8(AnsiStrA + AnsiStrA);  // UTF-8   ResultB :=
AnsiToUTF8(AnsiStrA) + AnsiToUTF8(AnsiStrA); // Win-1252

   
And resultA is not equal to ResultB

It doesn't look like too intuitive.

I would say that it is closer to "hidden secret knowledge" than to the
"Principle of least surprise".

-- 
Saludos

Santiago A.
svaa at ciberpiula.net




More information about the fpc-pascal mailing list