Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Convert Clipboard contents to plain text' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Convert Clipboard contents to plain text
Authored by: popguru on Jan 18, '12 04:46:15PM

I've used a script that just runs pbpaste | copy for years and wondered what the intent of the textutil in this hint was for. According to NSString docs, -encoding 30 corresponds to NSMacOSRomanStringEncoding. So this script will attempt to convert the text in the clipboard to Mac OS Roman. That means it also corrupts any unicode characters which cannot be expressed in Mac OS Roman (e.g. Japanese or Chinese characters).

Just wondering: Why would you want to convert the text to Mac OS Roman? Is this needed to paste in an application that expects Mac OS Roman rather than UTF-8?

[ Reply to This | # ]