Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/rbook/onix/xchar.rb

Instance Method Summary collapse

Instance Method Details

#to_xsObject

xml escaped version of to_s



56
57
58
59
60
# File 'lib/rbook/onix/xchar.rb', line 56

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