Copy/paste results in garbage if clipboard contains rich text on OS X

From: "Matt Magoffin" <postgresql(dot)org(at)msqr(dot)us>
To: pgadmin-support(at)postgresql(dot)org
Subject: Copy/paste results in garbage if clipboard contains rich text on OS X
Date: 2014-06-02 19:06:50
Message-ID: fbd5f36cd9cec0f898e4cb17fc95612b.squirrel@msqr.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Hello,

I often am working with SQL files in the Eclipse IDE on OS X. If I try to
copy a snippet of SQL from the Eclipse (http://www.eclipse.org) SQL editor
and then paste that into pgAdmin's SQL editor, it results in "garbage"
characters. If I paste into another text editor, like BBEdit, and then
copy the resulting text from the editor, and then paste into pgAdmin's SQL
editor, I get the expected results.

I suspect it has to do with the fact the clipboard contains rich text
(from syntax highlighting) along with the plain text. Indeed, if I use
Apple's sample Clipboard Viewer app to examine the contents of the
clipboard
(https://developer.apple.com/library/mac/samplecode/ClipboardViewer/Introduction/Intro.html)
I see that there is a RTF "flavor" that is listed first, followed by a
plain text UTF16 encoded "flavor", followed by a plain text UTF8 encoded
"flavor".

It would be great if the pgAdmin Paste command could find one of the plain
text "flavors" and use that instead of the RTF one.

pgAdmin version: 1.18.1 (OS X binary download)
OS: OS X 10.9.3
Steps: 1. Open a SQL file in the Eclipse SQL editor
2. Copy some portion of the SQL
3. Open a SQL editor window in pgAdmin
4. Paste

Expected result: The SQL text would be pasted into the editor.
Actual result: "Garbage" characters appear in the editor.
Workaround: Paste first into some other text editor, then copy/paste.

-- m@

Browse pgadmin-support by date

  From Date Subject
Next Message jackrg 2014-06-03 18:31:10 Sudenly unable to backup from database
Previous Message Dave Page 2014-06-02 18:42:03 Re: Re: PGAdmin for PostgreSQL 9.3 creates tables with double quotes embedded in the name