[fpc-pascal] WideStringReplace bug?

Lubos Pintes lubos.pintes at gmail.com
Tue Mar 28 11:24:26 CEST 2017


Sorry I forgot the FPC version:
3.1.1 [2017/02/15] for i386
Dňa 28. 3. 2017 o 11:22 Lubos Pintes napísal(a):
> Hello,,
> I am developing a console program which receives input in UTF-8, but it
> is converted to WideString for communication with COM.
> I found a weird behaviour of the WideStringReplace, and I extracted the
> small program below:
> program a;
> {$apptype console}
>
> uses SysUtils;
>
> var
>   U: UTF8String;
>   W: WideString;
>
> begin
>   U := 'left[*]paren';
>   W := WideStringReplace(WideString(U), WideString('[*]'), WideString('
> '), [rfReplaceAll]);
>   writeln(W);
> end.
>
> It seems to me that the output is garbaged, and it is not a problem of
> writeln, because I also obtained the weird result which was sent to SAPI.
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal





More information about the fpc-pascal mailing list