The original poster was apparently trying to make the
result safe to display. If that is your goal, then it did
not succeed. Conversely if that is not the goal then it
should have done nothing.
Also it is possible to do this safely. For a try at this
from me, take a look at Functional take 2.
Comment on Re (tilly) 4: Opinions needed on CGI security