修改或新增数据 提示编码错误

Blade 未结 1 441
Kurt
Kurt 剑童 2022-06-18 13:59

一、该问题的重现步骤是什么?

1. 添加或修改,提示编码错误

2. 数字或字符串都可以成功 只有中文编码出现错误


二、你期待的结果是什么?实际看到的又是什么?

修改过添加成功 实际看到报错信息

三、你正在使用的是什么产品,什么版本?在什么操作系统上?

后端boot 前端saber

四、请提供详细的错误堆栈信息,这很重要。

image.png

五、若有更多详细信息,请在下面提供。

image.png

前端报错:{"code":400,"success":false,"data":{},"msg":"JSON parse error: Invalid UTF-8 start byte 0xb2; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Invalid UTF-8 start byte 0xb2\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 12] (through reference chain: org.springblade.modules.desk.entity.Notice[\"title\"])"}


后端报错:

2022-06-18 13:56:01.367 ERROR 2528 --- [  XNIO-1 task-1] o.s.c.log.error.RestExceptionTranslator  : 消息不能读取:JSON parse error: Invalid UTF-8 start byte 0xb2; nested exception is com.fasterxml.jackson.databind.JsonMappingException: Invalid UTF-8 start byte 0xb2

 at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream); line: 1, column: 12] (through reference chain: org.springblade.modules.desk.entity.Notice["title"])



1条回答
  • 应该是编码不正确的数据 所以抛出了该异常 所以你先检查一下你Notice的title字段的数据

    0 讨论(0)
提交回复