how to prevent the problem from happening in the first place
Vim doesn't AutoCorrect anything. You only have to worry about text that comes from other applications.
how to detect whether the problem occurred
You can configure Vim to hilight all characters that might cause a problem, before you paste them into a terminal.
Add this to your .vimrc:
call matchadd('Error', '[^\t -~]') " hilight unicode characters that will cause problems if pasted into a Unix terminal
how to fix the problem after it has occurred