in reply to "Unrecognized character" stops perl cold

I find this very annoying also. It's because the perldoc renderer is doing silly things like replacing regular '-' dash/hyphen characters with chr(226) (instead of the normal chr(45) character) and replacing single ticks with the "prettier" version of the single quote. I have not been able to figure out how to get this to display properly without switching completely to raw or text mode.

My solution was to bind a key in vim to run this silly little script. So whenever I paste some code from some perldoc I'm viewing, I run this over the code.

#!/usr/bin/perl -n s/‐/-/g; s/−/-/g; s//'/g; print;

I notice it renders oddly in the perlmonks node, but you get the idea. I literally just copy and pasted the offending symbol into this script.


Therapy is expensive. Popping bubble wrap is cheap. You choose.