LCL-Win32: Convert clipboard CF_TEXT between WinCP and UTF-8. Issue #34073.

git-svn-id: trunk@58805 -
This commit is contained in:
juha 2018-08-31 07:55:17 +00:00
parent 066994a334
commit 26454daa11

View File

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