The code may be correct in itself, but it does the wrong thing.
If by strange you mean unknown to someone who only knows English, that's no excuse for removing any letters you don't know. Would you really want to look at street signs for Cafs
(which were legitimate Cafés
before)?
If you get strange character sequences like ö
, that's an encoding problemencoding problem and you need to fix it properly instead of hiding it.
If you really have to keep your code, at least be honest and replace each unknown character with a question mark or the Unicode replacement character so that it is clearly visible that something unexpected happened here.