简体   繁体   English

UTF-8字符编码不适用于Spring Boot

[英]UTF-8 character encoding is not working for spring boot

I have a spring boot application and it uses post to store the content using UTF-8 and read the contents also using UTF-8. 我有一个spring boot应用程序,它使用post来使用UTF-8存储内容,并使用UTF-8读取内容。 When i use any of the chinese characters i am getting the response as " " instead of the actual value. 当我使用任何中文字符时,响应都将显示为“ ...”,而不是实际值。 While I have set the UTF-8 for all incoming and outgoing values. 虽然我为所有传入和传出值都设置了UTF-8。

I have also wrote a filter which sets the character encoding for httpservletrequest and httpservletresponse which is being called but still it is not working. 我还编写了一个过滤器,该过滤器为正在调用的httpservletrequest和httpservletresponse设置字符编码,但仍然无法正常工作。

This is primarily a REST API and not returning the actual value instead it returns "?". 这主要是一个REST API,不会返回实际值,而是返回“?”。

I am using Spring Boot 1.2.3. 我正在使用Spring Boot 1.2.3。

您需要将数据库字符集更改为utf-8的超集utf8mb4,单击此处将为您提供帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM