mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-12 23:59:59 +02:00
LCL-Win32: Convert clipboard CF_TEXT between WinCP and UTF-8. Issue #34073.
git-svn-id: trunk@58805 -
This commit is contained in:
parent
066994a334
commit
26454daa11
@ -453,7 +453,7 @@ begin
|
|||||||
Size := Pos(#0, BufferString);
|
Size := Pos(#0, BufferString);
|
||||||
if Size > 0 then
|
if Size > 0 then
|
||||||
SetLength(BufferString, Size - 1);
|
SetLength(BufferString, Size - 1);
|
||||||
BufferString := AnsiToUtf8(BufferString);
|
BufferString := WinCPToUTF8(BufferString);
|
||||||
end;
|
end;
|
||||||
Stream.Write(BufferString[1], Length(BufferString));
|
Stream.Write(BufferString[1], Length(BufferString));
|
||||||
end;
|
end;
|
||||||
@ -615,7 +615,7 @@ function TWin32WidgetSet.ClipboardGetOwnerShip(ClipboardType: TClipboardType;
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
BufferString := Utf8ToAnsi(BufferString);
|
BufferString := UTF8ToWinCP(BufferString);
|
||||||
if BufferString<>'' then // original string may contain invalid UTF8
|
if BufferString<>'' then // original string may contain invalid UTF8
|
||||||
BufferStream.Write(BufferString[1], Length(BufferString));
|
BufferStream.Write(BufferString[1], Length(BufferString));
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user