Ruby: Find all special chars in String (umlauts etc)

on under asbach
1 minute read

Out Of Date Warning

This article was published on 26/10/2011, this means the content may be out of date or no longer relevant.
You should verify that the technical information in this article is still up to date before relying upon it for your own purposes.

>> text = "Grüße"
>> text.each_char.select{|i| i.bytesize != i.chars.count}.uniq
=> ["ü", "ß"]

Reposted from notes.it-jobs-und-stellen.de