diff --git a/components/lazutils/lazutf8.pas b/components/lazutils/lazutf8.pas index 73e12d1b54..b10e742365 100644 --- a/components/lazutils/lazutf8.pas +++ b/components/lazutils/lazutf8.pas @@ -176,7 +176,14 @@ end; function SysToUTF8(const s: string): string; begin if NeedRTLAnsi and (not IsASCII(s)) then - Result:=AnsiToUTF8(s) + begin + Result:=AnsiToUTF8(s); + {$ifdef FPC_HAS_CPSTRING} + // prevent UTF8 codepage appear in the strings - we don't need codepage + // conversion magic in LCL code + SetCodePage(RawByteString(Result), StringCodePage(s), False); + {$endif} + end else Result:=s; end;