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
1 2 3 4 5 6 7 8 9 10 | 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.