write_with_substitution(out, input)
Instance Public methods
Writes out text, substituting special characters beforehand.
out A String, IO, or any other object
supporting <<( String ) input the text to substitute and
the write out
z=utf8.unpack("U*")
ascOut=""
z.each{|r|
if r < 0x100
ascOut.concat(r.chr)
else
ascOut.concat(sprintf("&#x%x;", r))
end
}
puts ascOut
Please login to continue.