How do I remove non UTF-8 characters from a String in Ruby? : I have the following text:
-~$A§ruGù"š¶/K

I need to remove the non UTF-8 characters from it. I have tried `str.scrub` as well as `str.encode`. None of them seem to work.

`scrub` returns the same result and `encode` resutls in an error.

Here is the snap of the text.
[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/RmtYp.png