MappingJackson2XmlHttpMessageConverter should support non UTF charsets #34090
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
I currently have to deal with a REST API using
text/xml;charset=ISO-8859-1
as MediaType. So just usingMappingJackson2XmlHttpMessageConverter
seemed obvious to me. Unfortunately I found myself withAs it turns out, inheriting from
AbstractJackson2HttpMessageConverter
checks for hard-coded UTF encodings when callingMappingJackson2XmlHttpMessageConverter.canWrite()
spring-framework/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java
Lines 84 to 92 in 65553f5
spring-framework/spring-web/src/main/java/org/springframework/http/converter/json/AbstractJackson2HttpMessageConverter.java
Lines 273 to 283 in 65553f5
which is totally reasonable for JSON but not for XML. Overriding this method is not a problem at all but I wanted you to be notified at least.
The text was updated successfully, but these errors were encountered: