Кодировка JSON в UTF-8
Подскажите пожалуйста, как меняется кодировка в строке JSON консоли Intellij idea?
Мой код.
package reversbot.services;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.vk.api.sdk.client.TransportClient;
import com.vk.api.sdk.client.VkApiClient;
import com.vk.api.sdk.client.actors.UserActor;
import com.vk.api.sdk.exceptions.ApiException;
import com.vk.api.sdk.exceptions.ClientException;
import com.vk.api.sdk.httpclient.HttpTransportClient;
import com.vk.api.sdk.objects.wall.GetFilter;
import com.vk.api.sdk.objects.wall.responses.GetResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.io.DataInput;
import java.io.IOException;
import java.net.URLEncoder;
@Service
public class VkBot {
@Value("${APP_ID}")
int APP_ID;
@Value("${access_token}")
String access_token;
private String jsonString;
// @Scheduled(fixedDelay = 5000)
@PostConstruct
public void vkb() throws ClientException, ApiException, IOException {
TransportClient transportClient = new HttpTransportClient();
VkApiClient vk = new VkApiClient(transportClient);
UserActor actor = new UserActor(APP_ID, access_token);
GetResponse getResponse = vk.wall().get(actor)
.ownerId(-26493942)
.count(1)
.offset(5)
.filter(GetFilter.valueOf("ALL"))
.execute();
// getResponse = URLEncoder.encode(getResponse,"UTF-8");
System.out.println("........FROM HERE.........");
System.out.println(getResponse);
System.out.println(".........HERE........");
// jsonString = String.valueOf(getResponse);
//
// ObjectMapper mapper = new ObjectMapper();
// VkBot res = mapper.readValue(jsonString,VkBot.class);
// System.out.println(res);
}
}
В консоле выводятся знаки вопроса, вместо 'text'
"post","reposts":{"count":3,"user_reposted":0},"text":"?????????? ?????????? ????????? ?????? ??????? ??????? ? ????????? ??????? ?? ??????? ???. ?? ???? ??? ????????? ???? ?? ?????????? ????? � ???????......