import std.algorithm.comparison : equal; assert(equal(encodeText(`foo & bar`), `foo & bar`)); assert(equal(encodeText(`foo < bar`), `foo < bar`)); assert(equal(encodeText(`foo > bar`), `foo > bar`)); assert(equal(encodeText(`foo ' bar`), `foo ' bar`)); assert(equal(encodeText(`foo " bar`), `foo " bar`)); assert(equal(encodeText("foo ]]> bar"), "foo ]]> bar")); assert(equal(encodeText("hello world"), "hello world"));
Returns a lazy range of code units which encodes any characters which cannot be put in an dxml.parser.EntityType._text in their literal form.
encodeText is intended primarily to be used with dxml.writer.XMLWriter.writeText to ensure that characters which cannot appear in their literal form do not appear in their literal form.
Specifically, what encodeText does is