Search code examples
escapingguava

Guava: Where is CharEscaper?


I need to encode a string into Javascript text.

By googling I found the very useful function SourceCodeEscapers.javascriptEscaper which should be in Guava in the com.google.common.escape.CharEscaper package.

But it doesn't seem to be there in the actual Guava 13.0.1 release. (Also Dzone has a note about the new CharEscapers in Release 11, but I cannot find anything about it in the release notes.)

Has the CharEscaper-class moved? Was it never in Guava? Will it come in future releases?


Solution

  • It's not in Guava yet, but it will be. As I understand it, the API's still being tweaked and refined before we release it and get locked into supporting backward compatibility.