On Dec 14, 2003, at 4:10 PM, John Delacour wrote:
At 5:01 pm +0900 11/12/03, Robin wrote:late in on this one but you can treat the clipboard as a filehandle if you pipe to pbpaste and pbcopy :
open (FROM_CLIPBOARD, "pbpaste|"); open (TO_CLIPBOARD, "|pbcopy");
you can then do as you normally would for moving data to and from fle handles. See the typically useful-in-a-real-world-situation example script below
So far as I can see there is no way to use this useful technique with a clipboard containing Unicode text, for example Chinese or Greek text copied from TextEdit. Am I right?
That appears to be the case. The man page for pbpaste/pbcopy explicitly refers to ASCII.
perl -e 'print `pbpaste`'
Tends to print ?s for unicode characters or nothing at all depending on the shell.
Putting unicode on the clipboard and doing 'pbpaste|pbcopy' consistently mangles the contents of the clipboard in bash, tcsh, and zsh.
Looks like a good candidate to file a bug against.
Steven