[Lazarus] StringReplace loses non-ASCII characters in FPC 3.1.1

Juha Manninen juha.manninen62 at gmail.com
Tue Oct 20 22:40:02 CEST 2015


On Tue, Oct 20, 2015 at 10:11 PM, Ondrej Pokorny <lazarus at kluug.net> wrote:
>   SetMultiByteConversionCodePage(CP_UTF8);
>   SetMultiByteRTLFileSystemCodePage(CP_UTF8);
> helped.

Those functions are already called for you in the initialization
section of unit FPCAdds, package LazUtils.
Now it is :

 {$IF (FPC_FULLVERSION >= 30000) AND NOT DEFINED(DisableUTF8RTL)}
 initialization
   SetMultiByteConversionCodePage(CP_UTF8);
   // SetMultiByteFileSystemCodePage(CP_UTF8); not needed, this is the
default under Windows
   SetMultiByteRTLFileSystemCodePage(CP_UTF8);
 {$IFEND}

Earlier it used the EnableUTF8RTL flag.
I guess FPC's automatic rebuild system was confused by the changed
defines. Sometimes a clean build is needed.

Juha




More information about the Lazarus mailing list