Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/rfeedparser/encoding_helpers.rb

Instance Method Summary collapse

Instance Method Details

#to_xsObject



252
253
254
255
256
# File 'lib/rfeedparser/encoding_helpers.rb', line 252

def to_xs 
  unpack('U*').map {|n| n.xchr}.join # ASCII, UTF-8
rescue
  unpack('C*').map {|n| n.xchr}.join # ISO-8859-1, WIN-1252
end