Getting rid of abnormal Characters

ok, so i have no clue why this script i wrote spits out these bizarre characters:

i cant even copy and paste those characters on here because it just doesn't show up properly.

my question is, using sed, how can i get rid of all characters that aren't normal?

echo "abnormal characters" | sed .......?

I would like to get rid of any character that isn't on the keyboard. im not sure if i'm making sense. but, i hope you guys understand what i'm asking.

Perhaps stuff | tr -d '[\177-\377]'

Though it would be much better to just fix your script.

You can use:

strings -n1 File

Not a fix, but a method to see the characters:

sed -n l filename

Please post a representative sample.

I wonder if a Microsoft editor is involved somewhere in this problem?

Try this

echo "xyz" | sed 's/[[:cntrl:]]//g'