Out of curiosity, when your shell character set breaks from doing something like
cat /dev/urandom is there a way to fix that in place?
Try one of these:
If both don't work, or your terminal is so messed up that you can't even enter commands, then it is best to close the terminal and start a new one.
For more background information read "The Linux keyboard and console HOWTO" chapter "Resetting your terminal".