Skip to content

Instantly share code, notes, and snippets.

@asd1245dss
Created February 22, 2017 02:19
Show Gist options
  • Save asd1245dss/2d053c61f469d69f9221350287398b5c to your computer and use it in GitHub Desktop.
Save asd1245dss/2d053c61f469d69f9221350287398b5c to your computer and use it in GitHub Desktop.
Because the default encoding for ResiurceBunldeMessageSource is ISO-8859-1,so you should define the defaultEncoding to UTF-8
(stream != null) {
String encoding = getDefaultEncoding();
if (encoding == null) {
encoding = "ISO-8859-1";
}
try {
return loadBundle(new InputStreamReader(stream, encoding));
}
finally {
stream.close();
}
}
else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment