James Sabre wrote:'escaping' is only normally only needed in String literals within your Java source code. What makes you think you need to further escape some characters?
Ok.. I am creating a text file in java that will be fed to another System (a RDF database store). The text file created is having strings that are not escaped like below
"A "doctors" day"
"A PF\VPF Issue"
If you see in the two strings the first has two quotes(") that are not escaped & "\" in second string (PF\VPF) not escaped. Since the input strings are read from an XML (not well formed - source of error) i have to escape it now before feeding them to the System else which will throw the exact error -
\n, \r, \t, \", \\, \u or \U should be escaped