Sling model exporter with a different character encoding in the response | Community
Skip to main content
diegob27480086
Level 2
October 30, 2018
Solved

Sling model exporter with a different character encoding in the response

  • October 30, 2018
  • 2 replies
  • 2059 views

Hello everyone,

Does someone know how can I change the character encoding in the response on a sling model exporter?

Here a piece of code that I'm using

@Model(adaptables = SlingHttpServletRequest.class,
   resourceType = {"..."},
   defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL
)

@Exporter(name = "jackson", selector = "des", extensions = "json", options = {@ExporterOption(name = "SerializationFeature.WRITE_DATES_AS_TIMESTAMPS", value = "true")})

In the client I'm getting:

Content-Type:

application/json; charset=ISO-8859-1

But I'd like to use "UTF-8" instead of ISO-8859-1

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by diegob27480086

Thank you for you response. It is a bug and is reported here [SLING-7344] Jackson Sling Model Exporter needs correct character encoding - ASF JIRA .  The solution is upgrade the version of the bundle Models Implementation which you can download here Apache Sling :: Downloads

2 replies

arunpatidar
Community Advisor
Community Advisor
October 31, 2018
diegob27480086
diegob27480086AuthorAccepted solution
Level 2
October 31, 2018

Thank you for you response. It is a bug and is reported here [SLING-7344] Jackson Sling Model Exporter needs correct character encoding - ASF JIRA .  The solution is upgrade the version of the bundle Models Implementation which you can download here Apache Sling :: Downloads