The fonts used with the "Original TeX" encoding (aka OT1) don't have an underscore character: they are only 7 bit fonts (128 characters) and some positions are hijacked to make room for more useful characters. For example in the position of the underscore there is the "dot accent", in place of < and > there are ¡ and ¿.
So with the default OT1 encoding, the command \textunderscore (or \_) is defined to produce a small rule, which is not recognized by PDF viewers as a character.
The problem doesn't show when T1 encoded fonts are used, because this encoding has all the printable ASCII characters in their slots. So the answer is
\usepackage[T1]{fontenc}
Make sure to have available the CM-Super font package, or the T1 fonts will be in bitmap form. An alternative is to use also
\usepackage{lmodern}
since the Latin Modern fonts are almost the same as the European Modern that are chosen by default with T1 and are surely available as Type1 fonts.
\usepackage[T1]{fontenc}), otherwise the underscore is emulated with a rule and is not a character. – egreg Jan 30 '12 at 12:57\_instead, and this will copy the underscore no problem such as:test\_case. Try this for yourself to see. – night owl Jan 30 '12 at 13:00