Clipboard.GetText() always returns empty string in Mono on Mac

前端 未结 2 1404
一生所求
一生所求 2020-12-22 07:25

Is there a way to get the clipboard on a Mac in Mono that doesn\'t return an empty string? This is using the latest NON-beta version of mono.

Clipboard.SetText(Strin

2条回答
  •  旧巷少年郎
    2020-12-22 07:42

    It may be that mono is interpreting TextDataFormat.UnicodeText to mean utf-16 but the 'other application' is placing the text on the clipboard as utf-8.

    The following is a patch that, if I remember correctly, fixed an issue similar to this.

    clipboard patch

    You will need to build mono from and apply the patch to try this out.

提交回复
热议问题