Reputation: 2137
I need to know, If the string is in Arabic to change the layout of my html page. How do I do this?
Upvotes: 2
Views: 1453
Reputation: 19176
With latest ruby (at least 2.0.0 I think) also string =~ /\p{Arabic}/
will work
Upvotes: 5
Reputation: 271
You should be able to use a Unicode regular expression (example of Unicode in a Ruby regex) to check for the presence of Unicode Arabic characters.
Upvotes: 1