Convert a List of Objects to UTF-8 in java

1

I'm doing a system using java jsp, using webservice RESTful, where I only consume data from a webservice via a link . Then on the main page, I create a list of objects coming from webservice , I use Google's gson to generate my list of objects. The problem is that after generating this list, I have the problem of accentuating the words in this list of objects.

Would you like to know how I can convert this list so the accents are correct?

<%
  HttpExemplo teste = new HttpExemplo();
  String json = teste.sendGet();
  final Gson gson = new Gson();

  List<Cidade> cidade = gson.fromJson(json, List.class);
  if (tes != null) {
    Cidade city = new Cidade(tes);
    if (cidade.contains(city)) {
      city = cidade.get(cidade.indexOf(city));
    }
    out.println(city.getEstado());
  }
%>
    
asked by anonymous 05.03.2017 / 03:16

0 answers