[fpc-devel] Unicode support (yet again)

Michael Schnell mschnell at lumino.de
Thu Sep 15 11:26:16 CEST 2011


On 09/15/2011 10:39 AM, Graeme Geldenhuys wrote:
>
>    MyChar := UTF8Copy(MyString, 1, 1);
>
>
> The above example is safe,
Of course. But generations of Pascal programmers have been trained to do

MyChar := MyString[1];

So it would at least be candid to abolish the String[i] notation as a 
syntax feature, as it does not provide the result "normal" (Unicode 
unaware) users expect. (And provide an appropriate aromatically 
correctly coding aware library call - hopefully supported by appropriate 
syntax - candy instead). This of course would need either a dynamically 
coded "NewDelphiString" Type or different types for different coding 
variants.

-Michael



More information about the fpc-devel mailing list