Class: String

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

Instance Method Summary collapse

Instance Method Details

#to_xsObject



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

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