hey guys, I'm trying to integrate a resourceTool into spring. it worked just fine,only 1 problem, default encoding was ISO-8859-1. so..a bit of research and i came up with 3 possible solutions.
I. add a filter in web.xml : SetCharacterEncodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 forceEncoding true SetCharacterEncodingFilter /*
- add a line in the viewresolvers:
- manually changing the response's encoding: response.setContentType("text开发者_开发问答/html;charset=UTF-8"); response.setCharacterEncoding("UTF-8"); (set encoding is just making sure as content type also sets the encoding itself)
HOWEVER, as soon as i've done EITHER of those, all my strings turn to gibrish, also no matter to what encoding i change it remains gibrish( only gets worse if anything).
any ideas on how to solve it? anyone? ^_^
You should probably tell Velocity to use UTF-8 also, with the input.encoding and/or output.encoding properties.
精彩评论