[fpc-devel] ansistrings and widestrings

Alexey Barkovoy clootie at ixbt.com
Mon Jan 10 11:55:18 CET 2005


----- Original Message ----- 
From: "peter green" <plugwash at bircd.org>
To: "FPC developers' list" <fpc-devel at lists.freepascal.org>
Sent: Sunday, January 09, 2005 11:45 PM
Subject: RE: [fpc-devel] ansistrings and widestrings

>> Type
>>   // Lenght paremeters are number of CHARS not bytes
>>   TWide2AnsiMove=function(source:pwidechar; srclen:SizeInt;
>> dest:pansichar;
>> destlen:SizeInt): SizeInt;
>>   TAnsi2WideMove=function(source:pansichar; srclen:SizeInt;
>> dest:pwidechar;
>> destlen:SizeInt): SizeInt;
>>
>> These functions should return actual number of characters in
>> output. Returning
>> ZERO should indicate insufficient destination size.
>
> yes theese would be workabable but they seem to me to be a horrible Cism
>
> whats wrong with
>
> twidestringtoansistring=procedure(const source : widestring;var dest :
> ansistring);
> tansistringtowidestring=procedure(const source : ansistring;var dest :
> widestring);

Because we need to transform from PChar to WideString or from PWideChar to 
AnsiString or from Array [0..xx] of Char to WideString, etc. 





More information about the fpc-devel mailing list