I am trying to get this code to work (ruby 1.8.7):
line = "abc" "#{line}☃".encode('utf-8')[0..-2].scan(/\p{Katakana}/)
but returns an undefined method 'encode' for "abc\342\230\203":String (NoMethodError) .
You can run the program here: http://codepad.org/nh6cAqHT
Panagiotis panagi
source share