Translating unicode to plain text when pasting into Zotero

Many PDFs contain text in a variety of encodings. It is often useful to copy and paste text from a document into various fields of Zotero (e.g. the abstract), but sometimes the encoded text renders as meaningless symbols. It would be useful to automatically detect clipboard data that won't render in Zotero and to translate it into a plain text encoding. On a mac, the script
#!/bin/bash
#
# Convert contents of clipboard to plain text.

pbpaste | textutil -convert txt -stdin -stdout -encoding 30 | pbcopy

will convert arbitrarily encoded text in the clipboard into a standard encoding. Not sure what the equivalent commands are on Linux and Windows, but I'm sure they exist.
Sign In or Register to comment.