lazutils: fixed compilation under Windows

git-svn-id: trunk@50729 -
This commit is contained in:
mattias 2015-12-09 23:35:07 +00:00
parent f0d2cb9d8b
commit 9a471bcd00
2 changed files with 23 additions and 23 deletions

View File

@ -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}

View File

@ -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));