Enhance the Fixnum class with a XML escaped character conversion.
Methods
Constants
| XChar | = | Builder::XChar if ! defined?(XChar) |
Public Instance methods
XML escaped version of chr
[ show source ]
# File lib/builder/xchar.rb, line 93
93: def xchr
94: n = XChar::CP1252[self] || self
95: n = 42 unless XChar::VALID.find {|range| range.include? n}
96: XChar::PREDEFINED[n] or (n<128 ? n.chr : "&##{n};")
97: end