I am trying to escape a string object in my Java application using StringEscapeUtils.escapeHtml4
. I am using commons-lang3-3.5.jar library.
Below is the format I am trying to do -
StringEscapeUtils.escapeHtml4("user001")
When I print in console, the output looks like- "user001"
I actually don't want my double quot to be converted into escape characters here. Because, after escaping the string, my program doesn't recognize this as valid string and I am getting malformed JSon. Is there a way to handle this or any better way? Thanks in advance.