Description
Currently CharacterEscapes
allows for specifying custom escapes in general, as well as optimized checks for ASCII range of characters (as performance optimization).
But one internal optimization is not exposed via this interface: ability to indicate that "any character codes beyond N" (for example, above 7-bit ASCII range) are to be escaped using standard character escapes.
The reason this would be useful addition is that it would be more efficient for relatively common case of, say, escaping additional HTML characters AND non-ASCII or non-Latin1 characters as well.
Addition could be made in 2.10: but instead of adding this to CharacterEscapes
, it makes more sense to use new builder-based factory configuration, I think: mostly because it will be easier to keep pathway optimized -- behavior in much of code being that setting of non-null CharacterEscapes
will trigger different encoding pathway.