Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Fix the issue with special characters - Changed the default charset to UTF-8 to support special characters #660

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.util.StringUtils;
import org.springframework.web.util.WebUtils;

/**
* @author Agim Emruli
Expand Down Expand Up @@ -127,7 +126,7 @@ public InputStream getBody() throws IOException {

private Charset getCharset() {
return this.mediaType.getCharset() != null ? this.mediaType.getCharset()
: Charset.forName(WebUtils.DEFAULT_CHARACTER_ENCODING);
: Charset.defaultCharset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will use default charset from OS. According to SNS docs, strings are encoded with UTF-8 so perhaps instead we should use here StandardCharsets.UTF_8?

}

@Override
Expand Down