-
Dec 3rd, 2012, 10:12 AM
#1
RestTemplate is changing the UTF-8 charater to junk value
I'm using the rest template method
public <T> ResponseEntity<T> exchange(URI url, HttpMethod method, HttpEntity<?> requestEntity, Class<T> responseType)
where i have created HttpEntity using
HttpHeaders httpHeaders=new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_XML);
HttpEntity<Object> httpEntity = new HttpEntity<Object>(message.getPayload(), headers);
where my message.payload has value
<?xml version="1.0" encoding="utf-8"?>
<nickName>¥£</nickName>
However when the REST Service receives ¥£ this value it is turned into some junk value.
Is there something that needs to be done when calling the service using RestTemplate to ensure that the UTF-8 encoding is supported while parsing the xml values in the HttpEntity.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules