I have an array full of user logins that was loaded from the database. What's the simplest and efficient way to keep only the logins that contain non-ascii characters?
logins = Users.find(:all).map{|user|user.login}
logins_with_non_ascii_characters = logins.select{ |login| ...??? }
Thanks
Edit: if you have a SQL solution (I use MySQL, but a generic solution would be better) to filter out the logins directly on the first line, with a :conditions clause, I'm ok with that too. In fact, it would be way more efficient:
logins = Users.find(:all, :conditions => "...???").map{|user|user.login}