Setting the $KCODE global variable to 'u' and loading jcode gives regular expressions awareness of UTF-8 characters : KCODE « Development « Ruby






Setting the $KCODE global variable to 'u' and loading jcode gives regular expressions awareness of UTF-8 characters


$KCODE = 'u'
require 'jcode'

"".scan(/./) do |character|
  puts character
end

 








Related examples in the same category

1.Using jcode you can make regular expressions UTF-8 aware
2.$KCODE Demo
3.$KCODE = 'u'
4.Handling International Encodings
5.Check string size for non ascii code
6.Count non-ascii string
7.Length of non-ascii string