I couldn't find any explanation why StringEscapeUtils was deprecated from Apache Lang3 v3.7.
https://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringEscapeUtils.html
What are we supposed to use now for HTML escaping/unescaping
@user3871754 No, it is deprecated in the org. apache. commons. lang3 as it was adopted here in org.
Description. org.apache.commons.lang3. Provides highly reusable static utility methods, chiefly concerned with adding value to the java. lang classes.
Method SummaryReturns a String value for a CSV column enclosed in double quotes, if required. Escapes the characters in a String using EcmaScript String rules. Escapes the characters in a String using HTML entities. Escapes the characters in a String using HTML entities.
The class was moved from package
org.apache.commons.
lang3
to
org.apache.commons.text
You can replace the deprecated library easily:
In your build.gradle:
implementation 'org.apache.commons:commons-text:1.9'
And in your class using StringEscapeUtils
make sure you import the correct class:
import org.apache.commons.text.StringEscapeUtils;
1.9 is currently the newest version (last checked February 24th 2021) but you can check the versions at maven: https://mvnrepository.com/artifact/org.apache.commons/commons-text
Per the deprecation listing, it was moved to a new project -- commons-text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With