[fpc-pascal] Help making code unicode capable

Marc Weustink marc at dommelstein.net
Sat Nov 10 16:59:59 CET 2007


Felipe Monteiro de Carvalho wrote:
> Hello,
> 
> I have a small piece of code on LCL which I have found hard to convert
> to unicode:
> 
>       lpStrFilter := StrAlloc(Length(Filter)+1);
>       StrPCopy(lpStrFilter, Filter);

There is a big chance that this is an inheritence of the pre 1.0 fpc 
times. At that time Casting a string to a PChar didn't work reliable, so 
all in all cases where you now would use PChar(S) these constructs where 
used.
I think in this case you now simply can use a sting (or widestring)

Marc





More information about the fpc-pascal mailing list