core :: Text :: escape_to_utf16
self
with all characters escaped with their UTF-16 representationassert "Aรจใ๐".escape_to_utf16 == "\\u0041\\u00e8\\u3042\\ud800\\udfd3"
# Returns `self` with all characters escaped with their UTF-16 representation
#
# ~~~
# assert "Aรจใ๐".escape_to_utf16 == "\\u0041\\u00e8\\u3042\\ud800\\udfd3"
# ~~~
fun escape_to_utf16: String do
var buf = new Buffer
for i in chars do buf.append i.escape_to_utf16
return buf.to_s
end
lib/core/text/abstract_text.nit:846,2--855,4