-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Document why "charset=UTF-8" is specified for JSON and not for XML [SPR-14715] #19280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Manuel Jordan commented BTW It fails even when I add converter.setSupportedMediaTypes(Arrays.asList(MediaType.APPLICATION_XML)); It according with the MappingJackson2XmlHttpMessageConverter API which says:
Theoretically with is It the idea projected? |
Sébastien Deleuze commented There is various things to consider here. As described in #18209, as of Spring Framework 4.3, the produces attributes can be used to specify the media types supported without losing the charset. This is especially useful for JSON because browsers don't use UTF-8 by default if this charset in not specified in the
I think introducing Instead of adding Any thoughts Rossen Stoyanchev Juergen Hoeller? |
Manuel Jordan commented Hello Sébastien Thanks by the reply.
Interesting. Perhaps is related with other JIRA I've created some time ago: Agree about One I've removed all the Two the charset reported here. I am agree and I understand the importance of
You are the expert here. But friendly I will say not, because from Rest we have some kinds of clients/consumers:
Not sure if your idea affects Even if Kind Regards |
Sébastien Deleuze commented Indeed, I already linked the related #18178 issue. My point is that characters like Any thoughts? |
Manuel Jordan commented Some thoughts about this situation? Seems has sense work around To avoid confusions what I understood is that for production is that |
Sébastien Deleuze commented Since the Chrome bug has been fixed in Chrome 62 (we are now on Chrome 65 and it is expected to be an evergreen browser automatically updated), I am wondering if we could not switch back to Any thoughts Rossen Stoyanchev Brian Clozel? |
Brian Clozel commented Hey Sébastien Deleuze, do we know if that bug has been fixed in other browsers as well (Edge, Firefox, Safari and all the Webkit-based ones). I guess Chrome and others don't share the same browser engine anymore? |
Sébastien Deleuze commented It is fixed in Firefox for more than 1 year ago, but indeed we need to test with Edge and Safari. |
Manuel Jordan commented For Spring: What is the official list of Web Browsers to have a track control of this kind of bug. My point, not sure if this bug is fixed or not in Vivaldi and SeaMonkey |
Sébastien Deleuze commented After a test with Safari and this URL it appears that the bug is still present for at least Safari, so we need to keep current behavior. So I will turn this issue as a documentation one, to give more insight to users why we specify UTF-8 for JSON and not for XML. |
Manuel Jordan commented Could you share please the github pull request? Thanks |
Sébastien Deleuze commented The related commit is this one, please note that you can see related commits with the links under the Development section at the right of that page. |
Manuel Jordan commented Thanks for the link. Yes, I forget about that, sorry. |
Uh oh!
There was an error while loading. Please reload this page.
Manuel Jordan opened SPR-14715 and commented
Hello
I just added the
jackson-dataformat-xml
module to my project and the followingNow my test classes are failing with the following error message:
Therefore in the same way the MediaType class has declared
The same consideration would be for XML.
My RestController has currently the following:
Thank you.
Affects: 4.3 GA, 4.3.1, 4.3.2
Issue Links:
Referenced from: commits 27e87e5, 3879179
The text was updated successfully, but these errors were encountered: