Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update spring-web/src/main/java/org/springframework/http/converter/Strin... #193

Closed
wants to merge 1 commit into from

2 participants

@zhengxiaochuan

...gHttpMessageConverter.java

Change the default charset from "ISO-8859-1" to "UTF-8" in the class StringHttpMessageConverter.
Because if response body has Chinese, there will have Garbage characters.

@zhengxiaochuan zhengxiaochuan Update spring-web/src/main/java/org/springframework/http/converter/St…
…ringHttpMessageConverter.java

Change the default charset from "ISO-8859-1" to "UTF-8" in the class StringHttpMessageConverter.
Because if response body has Chinese, there will have Garbage characters.
ef70e97
@rstoyanchev
Owner

We can't change this for backwards compatibility reasons. Please, use the defaultCharset constructor argument.

@zhengxiaochuan zhengxiaochuan deleted the zhengxiaochuan:patch-1 branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 29, 2012
  1. @zhengxiaochuan

    Update spring-web/src/main/java/org/springframework/http/converter/St…

    zhengxiaochuan authored
    …ringHttpMessageConverter.java
    
    Change the default charset from "ISO-8859-1" to "UTF-8" in the class StringHttpMessageConverter.
    Because if response body has Chinese, there will have Garbage characters.
This page is out of date. Refresh to see the latest.
View
2  spring-web/src/main/java/org/springframework/http/converter/StringHttpMessageConverter.java
@@ -41,7 +41,7 @@
*/
public class StringHttpMessageConverter extends AbstractHttpMessageConverter<String> {
- public static final Charset DEFAULT_CHARSET = Charset.forName("ISO-8859-1");
+ public static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
private final Charset defaultCharset;
Something went wrong with that request. Please try again.