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

26th October 2011 – 53 words
>> text = "Grüße"
>> text.each_char.select{|i| i.bytesize != i.chars.count}.uniq
=> ["ü", "ß"]

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