Skip to content

writing Unicode text to the Windows clipboard

3 messages · Jennifer Bryan, Jeroen Ooms, Martin Maechler

#
Hello,

I'm interested in moving text from and to the clipboard that cannot
necessarily be represented in the native encoding. So, really, this is
about Windows.

I can successfully read from the clipboard by specifying the format that
corresponds to unicode text.
2 days later
#
On Fri, May 24, 2019 at 12:06 AM Jennifer Bryan <jenny at rstudio.com> wrote:
Thanks!

I tested this and can confirm that this patch works. With this change,
any (non ascii) unicode text now properly copies and pastes from/to
the Windows clipboard.
1 day later
#
> Hello, I'm interested in moving text from and to the
    > clipboard that cannot necessarily be represented in the
    > native encoding. So, really, this is about Windows.

    > I can successfully read from the clipboard by specifying
    > the format that corresponds to unicode text.

    >> From R >=2.7.0, it seems you should also be able to write
    >> unicode text
    > to the Windows clipboard.

    > https://github.com/wch/r-source/blob/5a156a0865362bb8381dcd69ac335f5174a4f60c/src/gnuwin32/CHANGES0#L535-L536

    > However, in my hands, this does not seem to be true. I can
    > make it work with this change:
Thank you, Jenny -- and Jeroen for confirmation!

I've now found the time to read up a bit on this, notably ?writeClipboard
and the underlying source code,
and just from that reading I'd agree that the change seems a
clear improvement and does what indeed the documentation had
suggested all along.

I'll commit the change to R-devel .. and plan to port it to 'R
3.6.0 patched' in a few days.

Martin