How to correct the unrecognizable code in my debian?

Solution 1:

SI/SO VT100 Control Characters

The garbled characters are likely due to the terminal getting a SI character (Shift In; ASCII 14; Control-N). SI is a VT100 control character that can cause the terminal to switch to an alternate character set. Many real terminals (e.g. an actual hardware device, or just the text-only console of an OS) and terminal programs honor this escape code.

The direct way to switch back to the normal character set is to send a SO character (Shift Out; ASCII 15; Control-O) to the terminal.

Recovery

Because the character set is switched, you may have to type the recovery commands “blind” (without relying on seeing what you have typed).

Usually the echo command will be useful. Often you can type
E C H O Space Control-V Control-O Enter / Return
to get the terminal to see a Control-O (the Control-V tells the input-side of the terminal that the next is to be passed literally, otherwise the input side will ‘eat’ the character before it gets the the shell and thus before it can be sent back to the output side of the terminal).

If you can assume a reasonable shell with a printf builtin (or no shell builtin and a reasonable external printf command), you can use printf '\017' to send a Control-O to the terminal.

Solution 2:

Did you try the unix reset command?

This is usually the result of dumping a binary file (a program, or a data file) to the terminal (cat some.mp3 or similar). Usually typing reset will get your terminal back in order. If that doesn't work, the next thing to try is a reset function on your terminal application -- look for it in the application's menus. (PuTTY, for example, has a Reset Terminal in its system menu.)

Rarely, neither of these work, and you'll just have to shut down that terminal or shell and start another one.