1

My aim is getting user info by accessToken using facebook api.I get response but email in this response is like this: aaaaaa\u0040mail.com.

For converting i add some properties but this doesn't work

RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters().add(0, new StringHttpMessageConverter(Charset.forName("UTF-8")));

String facebook = restTemplate.getForObject(
            "https://graph.facebook.com/me?access_token=" + facebookAccessToken,
            String.class);

How can i convet this email to: aaaaaa@mail.com

Sarkhan
  • 1,281
  • 1
  • 11
  • 33

1 Answers1

1

You can use the Apache Commons Lang. There's a method called StringEscapeUtils.unescapeJava(String s) That can do it.

(From https://stackoverflow.com/a/14368185/1176061)

Community
  • 1
  • 1
DeadChex
  • 4,379
  • 1
  • 27
  • 34