富文本编辑器首行输入是空格后台接收变成?的问题解决
富文本编辑器首行输入是空格后台接收变成?问号的问题解决
@RequestMapping("/kms/faq/reply/updateReply") public ModelAndView updateReply(Reply reply){ String content=reply.getContent(); byte bytes[]={(byte) 0xC2,(byte) 0xA0}; try { //转换编辑器首行是个空格变?的问题 String UTFSpace=new String(bytes,"utf-8"); String c=content.replaceAll(UTFSpace," "); reply.setContent(c); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } replyService.update(reply); String sql = "select questionid from reply where id = ?"; String id = dataService.getValueStr(sql, reply.getId()); return new ModelAndView("redirect:/kms/faq/view.do?id="+id); }