Plain text clipboard - Incorrect fix in 3.2.0.3

Hello,

In 3.2.0.3 in FMX.TMSRichEditor.pas you wrote:
Fixed : Issue with clipboard plain text

Unfortunately, it is not true (for Windows).
Wen I compare with 3.2.0.3 with 3.2.0.0 then I can see that you changed CF_UNICODETEXT into CF_TEXT in function TTMSFMXClipBoard.GetFormat (unit FMX.TMSBaseControl.pas).
So while in 3.2.0.0 you were considering Unicode in plain text Clipboard operations, in 3.2.0.3 you assume Windows 8-bit encoding. It's a quite a bit of downgrade...

The point is that the problem in 3.2.0.0 (and 3.2.0.3, too) was elsewhere:
In function TTMSFMXClipBoard.GetValue, in its {$IFDEF MSWINDOWS} part there is this code:
else if isTextFormat(AFormat) then
begin
  txt := UTF8ToString(pMem);
  Result := txt;
end
And that is wrong for both CF_UNICODETEXT (because when you ask for Unicode string then you get it as UTF16, not as UTF8) and CF_TEXT (because then you get the text encoded in Windows-1252 or Windows-1250 or in one of the other ten or so 8-bit encodings, not in UTF8). So while in 3.2.0.0 the plain text did not work at all (except when one ASCII letter was in the clipboard), in 3.2.0.3 it works sometimes (when you only try ASCII letters, no special national characters).

I suggest this fix for an upcoming version:
1. Revert to CF_UNICODETEXT in TTMSFMXClipBoard.GetFormat
2. change the code in TTMSFMXClipBoard.GetValue like this:
        else if isTextFormat(AFormat) then
        begin
          if AFormat = CF_UNICODETEXT then
            txt :=pchar(pMem)
          else
            txt := UTF8ToString(pMem);
          Result := txt;
        end
3. Please revisit also TTMSFMXClipBoard.SetValue. It should put there an UTF16 string in case of CF_UNICODETEXT and an UTF-8 string in case of HTML or RTF (in case of RTF it is in fact ASCII text, I think).

Thanks

Thanks for your feedback.
We applied improvements that will be incorporated in the next update.