Constructor @param arg if a String, the
content is set to the String. If a Text, the object is shallowly cloned. If a Source, the source is parsed for text content up to
the next element. If a parent, the parent of this object is set to the
argument. @param whitespace (boolean, optional) if true, whitespace is
respected @param parent (Parent, optional) if
given, the parent of this object will be set to the argument
remove write_with_substitution; what we
want to do is read and save the raw input. When the users ask for the
string, we do the conversion then. When we write, we write back out the raw
string. Thus we avoid changing the user's text, and speed everything up!
Writes out text, substituting special characters beforehand. @param out A
String, IO, or any other object supporting
<<( String ) @param 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