0

Consider the following JSON Object,

{
     "params":[{
                  "name":"param1",
                   "value" : "%0A"
               },
               {
                  "name":"param2",
                   "value" : "%09"
               },
                {
                  "name":"param3",
                   "value" : "hello%09"
               }]
}

If you notice, the value fields are all encoded form of escape characters (in this case, \n, \t, hello\t respectively). Assume I can retrieve these values as params.getValue(). Now how can I decode them and get the actual values i.e \n, \t, hello\t in my example ?

Suraj HK
  • 289
  • 2
  • 10
  • 20
  • by adding (basically the same) escape character. just check this print statement: System.out.println("\\n \n end"); – Stultuske Jan 06 '15 at 11:03

1 Answers1

1

Try to use StringEscapeUtils from apache commons-lang.

Jens
  • 67,715
  • 15
  • 98
  • 113