Actually, esc()shouldn’t really be used for user input like that.
esc()
@ezraverheijen wrote about this here recently.