[fpc-devel] fpc_ShortStr_To_WideStr

peter green plugwash at bircd.org
Mon Mar 21 22:51:55 CET 2005


oops looks like i commented out the wrong line when changing the
widestringmanager system for improved flexibility.

the code should be:

Function fpc_ShortStr_To_WideStr (Const S2 : ShortString): WideString;
{$ifdef hascompilerproc} compilerproc; {$endif}
{
  Converts a ShortString to a WideString;
}
Var
  Size : SizeInt;
begin
  Size:=Length(S2);
  //Setlength (fpc_ShortStr_To_WideStr,Size);
  if Size>0 then
    begin

widestringmanager.Ansi2WideMoveProc(PChar(@S2[1]),fpc_ShortStr_To_WideStr,Si
ze);
      { Terminating Zero }

PWideChar(Pointer(fpc_ShortStr_To_WideStr)+Size*sizeof(WideChar))^:=#0;
    end;
end;


> -----Original Message-----
> From: fpc-devel-bounces at lists.freepascal.org
> [mailto:fpc-devel-bounces at lists.freepascal.org]On Behalf Of C Western
> Sent: 21 March 2005 21:37
> To: FPC developers' list
> Subject: [fpc-devel] fpc_ShortStr_To_WideStr
>
>
> Is the assignment to Size meant to be commented out? (I have just
> started having trouble with a program which I think has just started
> using widestrings because the DOM unit has been switched to widestrings.)
> Colin
>
> Function fpc_ShortStr_To_WideStr (Const S2 : ShortString): WideString;
> {$ifdef hascompilerproc} compilerproc; {$endif}
> {
>   Converts a ShortString to a WideString;
> }
> Var
>   Size : SizeInt;
> begin
>   //Size:=Length(S2);
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel





More information about the fpc-devel mailing list