If you find that you are unable to achieve the desired behavior It is strongly recommended that when implementing a new escaper youĮxtend one of these classes. They are heavily optimized for performance and greatly simplify the task of The two primary implementations of this interface are CharEscaper and UnicodeEscaper. With short strings already known to be free of unpaired surrogates. Splitting an existing long string into short strings adaptively around surrogate pairs, or by starting The only case in which it is safe toĮscape strings and concatenate the results is if you can rule out this possibility, either by This isīecause of the possibility of splitting a surrogate pair. Individual char values, it is not safe to assume that escape(s) is equivalent toĮscape(s.substring(0, n)) + escape(s.substing(n)) for arbitrary n. Resulting XML document is parsed, the parser API will return this text as the original literalĪn Escaper instance is required to be stateless, and safe when used concurrently byīecause, in general, escaping operates on the code points of a string and not on its Text is performed automatically by the relevant parser.įor example, an XML escaper would convert the literal string "Foo" into "Foo" to prevent "" from being confused with an XML tag.Typically (but not always), the inverse process of "unescaping" the An object that converts literal text into a format safe for inclusion in a particular context
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |