-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchesstatus: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement
Milestone
Description
Thomas Ziem opened SPR-7904 and commented
Currently, StringHttpMessageConverter uses ISO-8859-1 as default charset for reading and writing:
public static final Charset DEFAULT_CHARSET = Charset.forName("ISO-8859-1");
protected String readInternal(Class clazz, HttpInputMessage inputMessage) throws IOException {
MediaType contentType = inputMessage.getHeaders().getContentType();
Charset charset = contentType.getCharSet() != null ? contentType.getCharSet() : DEFAULT_CHARSET;
return FileCopyUtils.copyToString(new InputStreamReader(inputMessage.getBody(), charset));
}
It would be nice if it could be configured from outside.
Affects: 3.0.5
Issue Links:
- Backport constructor accepting Charset in StringHttpMessageConverter, from Spring for Android to Spring Web. [SPR-9487] #14122 Backport constructor accepting Charset in StringHttpMessageConverter, from Spring for Android to Spring Web. ("duplicates")
- Make it easier to add new Message Converters to AnnotationMethodHandlerAdapter [SPR-7504] #12161 Make it easier to add new Message Converters to AnnotationMethodHandlerAdapter
Backported to: 3.1.2
3 votes, 1 watchers
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: backportedAn issue that has been backported to maintenance branchesAn issue that has been backported to maintenance branchesstatus: duplicateA duplicate of another issueA duplicate of another issuetype: enhancementA general enhancementA general enhancement