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 spring-projectsgh-26627
  • Loading branch information
poutsma authored and lxbzmy committed Mar 26, 2022
1 parent 7b4d1a1 commit fc9bebf
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 fc9bebf

Please sign in to comment.