diff --git a/components/lazutils/lazutf8.pas b/components/lazutils/lazutf8.pas index 591e447c97..b9a5e91e42 100644 --- a/components/lazutils/lazutf8.pas +++ b/components/lazutils/lazutf8.pas @@ -314,29 +314,6 @@ begin {$ENDIF} end; -function WinCPToUTF8(const s: string): string; -begin - if NeedRTLAnsi and (not IsASCII(s)) then - 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; - -function UTF8ToWinCP(const s: string): string; -begin - if NeedRTLAnsi and (not IsASCII(s)) then - Result:=UTF8ToAnsi(s) - else - Result:=s; -end; - function GetEnvironmentStringUTF8(Index: Integer): string; begin {$IFDEF FPC_RTL_UNICODE} diff --git a/components/lazutils/unixlazutf8.inc b/components/lazutils/unixlazutf8.inc index faddf782be..6c6a885685 100644 --- a/components/lazutils/unixlazutf8.inc +++ b/components/lazutils/unixlazutf8.inc @@ -10,6 +10,29 @@ begin Result := UTF8ToSys(s); end; +function WinCPToUTF8(const s: string): string; +begin + if NeedRTLAnsi and (not IsASCII(s)) then + 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; + +function UTF8ToWinCP(const s: string): string; +begin + if NeedRTLAnsi and (not IsASCII(s)) then + Result:=UTF8ToAnsi(s) + else + Result:=s; +end; + function ParamStrUTF8(Param: Integer): string; begin Result:=SysToUTF8(ObjPas.ParamStr(Param));