Questions tagged [stringescapeutils]

'StringEscapeUtils' is a java class in the Text subproject of the Commons project from Apache Software Foundation (ASF). The class was formerly in the Lang subproject. The purpose of the class is to escape and unescape strings for Java, Java Script, HTML and XML. Use this tag for questions regarding the StringEscapeUtils class.

StringEscapeUtils is a java class in the Apache Commons Text project. The class was originally part of the Commons Lang project but was migrated to the Commons Text project. The class is used to convert characters in strings to their equivalent entity and vice-versa. This is known as escaping (or unescaping) characters. For example the [HTML] entity for the & (ampersand) character is &. Hence class StringEscapeUtils contains methods for converting & to & as well as methods for converting & to &. The class also contains methods for escaping and unescaping characters in JavaScript and XML as well as HTML.

82 questions
0
votes
2 answers

PHP Escape character

I'm using PHP environment and I have a problem in displaying data on form of escape characters. example: how could i display a double quote " if my string data is \" same with, how could i display a backslash \ if my string data is \\
Mark
  • 314
  • 1
  • 5
  • 17
-1
votes
2 answers

Escaped unicode characters are escaped again with StringEscapeUtils.escapeXml

I have a text "Begünstigter" which I'm trying to escape the character 'ü' with StringEscapeUtils.escapeXml. As the code for 'ü' is ü, I would expect the method to return Begünstigter. However, StringEscapeUtils.escapeXml is somehow doing…
Eda
  • 93
  • 9
-1
votes
1 answer

How to unescape xml in java?

Unfortunately all about this topic is too old, so i need a help. How i can unescape xml in java? I tried StringEscapeUtils.unescapeXml from import org.apache.commons.lang3.StringEscapeUtils; but it's deprecated. I also tried StringEscapeUtils as an…
Tomáš Mejzr
  • 357
  • 1
  • 5
  • 11
-1
votes
2 answers

Do I have a data issue or a string escaping issue and how do I fix it?

In my Java web app I pull a property from the database and send it to the view/browser layer via the controller. In the HTML, I am expecting the string to look like this: 9" nails Instead it looks like this: "9\" nails" So I plugged Apache…
-2
votes
1 answer

Escape a uppercase char with accent?

here is my problem. When my webapp prints a text that i'm escaping with StringEscapeUtils library, if the text contains 'ÁÉÍÓÚ' in the PDF result missing those letters, only if they are uppercase. for example: 'LOS MÉDICOS ESTÁN EN EL TURNO DE…
-2
votes
1 answer

Xml parsing in java changing string

I am making a chatting application through smack api. When I send message which include this character ', the output comes as message== ma'am output== ma ' am here is the code StringEscapeUtils.unescapeHtml((new String(ch, start,…
Complicated
  • 117
  • 2
  • 16
-3
votes
2 answers

New to Python(3), may I ask for some help on my homework?

My homework asks to create a variable that contains a string. The string is to contain a few phrases, line breaks, and other variables that contain strings and an integer. So far I am running into a few errors, namely the "unexpected character after…
1 2 3 4 5
6