mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 01:49:27 +02:00
lazutils: fixed compilation under Windows
git-svn-id: trunk@50729 -
This commit is contained in:
parent
f0d2cb9d8b
commit
9a471bcd00
@ -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}
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user