Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'd love a utility that takes text from my clipboard, converts it to ASCII and strips all formatting, then pastes it. It would need to map Unicode (and other character set) characters to ASCII equivalents, but even if it covered only the common characters I would be very happy. Any tips?

EDIT: minor edits



On Windows, AutoHotkey has all the tools you need for this. The built-in `Clipboard` variable contains only the textual data, and the `OnClipboardChange` event allows you to watch the clipboard for changes. You could then use regular expressions to remove unwanted characters and formatting.


On macOS I use the fact that pasting in the console strips all formatting. `pbpaste | pbcopy` in my terminal pastes to plain text then copy it again. It doesn’t map Unicode to ASCII, though.


What about using Shift+Option+Command+V to paste without formatting? isn't that easier?


Yeah it’s easier if you remember it, which I don’t :)


KDE's clipper lets you do actions, so provided you have a script to convert input text to unformatted or ASCII or what-have-you then it's 2 clicks to get it in to your clipboard ready to paste.


iconv will convert encodings and do things like "translit" mode converting for ß to ss, € to Eur, and ö to oe.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: