1. Reason
Since the default character set of the StringHttpMessageConverter initialized by the default construction method of RestTemplate is ISO-8859-1, the response content of the RestTemplate request will appear Chinese garbled.
2. Solve
When configuring @Bean in springboot, the StringHttpMessageConverter encoding should be changed to UTF8 format. as follows:
@Bean
public RestTemplate restTemplate() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8));
return restTemplate;
}