Skip to content

Commit

Permalink
Support UTF-16/UTF-32 in Jackson message converter
Browse files Browse the repository at this point in the history
This commit makes sure that we let Jackson deal with all the encodings
that it supports, including UTF-16 and UTF-32.

Closes gh-26627
  • Loading branch information
poutsma committed Mar 2, 2021
1 parent 7efb4ea commit b61643b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ private Object readJavaType(JavaType javaType, HttpInputMessage inputMessage) th
ObjectMapper objectMapper = selectObjectMapper(javaType.getRawClass(), contentType);
Assert.state(objectMapper != null, "No ObjectMapper for " + javaType);

boolean isUnicode = ENCODINGS.containsKey(charset.name());
boolean isUnicode = ENCODINGS.containsKey(charset.name()) ||
"UTF-16".equals(charset.name()) ||
"UTF-32".equals(charset.name());
try {
if (inputMessage instanceof MappingJacksonInputMessage) {
Class<?> deserializationView = ((MappingJacksonInputMessage) inputMessage).getDeserializationView();
Expand Down

0 comments on commit b61643b

Please sign in to comment.