Class: Fixnum

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

Instance Method Summary collapse

Instance Method Details

#xchrObject

xml escaped version of chr



242
243
244
245
246
247
248
249
250
# File 'lib/rfeedparser/encoding_helpers.rb', line 242

def xchr
  n = XChar::CP1252[self] || self

  case n when *XChar::VALID
    XChar::PREDEFINED[n] || (n<128 ? n.chr : "&##{n};")
  else
    '*'
  end
end