JSON character encoding

后端 未结 10 1025
春和景丽
春和景丽 2020-11-27 14:14

My Java web application submits an AJAX request that returns JSON such:

{\'value\': \'aériennes\'}

When \'aériennes\' is displayed in the w

10条回答
  •  囚心锁ツ
    2020-11-27 15:18

    If the suggested solutions above didn't solve your issue (as for me), this could also help:

    My problem was that I was returning a json string in my response using Springs @ResponseBody. If you're doing this as well this might help.

    Add the following bean to your dispatcher servlet.

    
        
            
                
                    
                        
                            text/plain;charset=UTF-8
                        
                    
                
            
        
    
    

    (Found here: http://forum.spring.io/forum/spring-projects/web/74209-responsebody-and-utf-8)

提交回复
热议问题