lazutils: fixed compilation under Windows

git-svn-id: branches/fixes_1_6@50730 -
This commit is contained in:
mattias 2015-12-09 23:35:22 +00:00
parent 7b07b8b374
commit fe98c36e7d
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));