Driving 12V signal from 5V pin

It depends on what you want the signal to be when it is not 12V. If it is zero volts then a simple transistor will do as in the above link. However I have had eproms that required to switch between 5V and 12V. Which is it?