Ruby 1.8.6 and Unicode
Using Ruby 1.8.6 (p111)
In irb
$KCODE='u' 'aébvHögtåwHÅFuG'.scan(/./u)
nicely yields
["a", "é", "b", "v", "H", "ö", "g", "t", "å", "w", "H", "Å", "F", "u", "G"]
and
'aébvHögtåwHÅFuG'.scan(/[\x00-\x7F]/u).join('')
neatly removes all non-ASCII characters.
No Comments
No comments yet.
RSS feed for comments on this post. TrackBack URI
Leave a comment
You must be logged in to post a comment.