request.getInputStream中文乱码解决方案
StringBuilder buffer = new StringBuilder();
BufferedReader reader=null;
try{
reader = new BufferedReader(new InputStreamReader(final_request.getInputStream(),"UTF-8"));
String line=null;
while((line = reader.readLine())!=null){
buffer.append(line);
}
}catch(Exception e){
e.printStackTrace();
}finally{
if(null!=reader){
try {
reader.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
buffer.toString()
"monId":"20191229135102184",
"groupId":"004",
"proberId":"03",
"title":"TTTTTT",
"monType":"c01-job-running-error"
HttpServletResponse response) throws Exception {
System.out.println("into webinterface down gate");
//request.setCharacterEncoding("GBK");
request.setCharacterEncoding("UTF-8");
StringBuffer str = new StringBuffer();
try {
//BufferedInputStream in = new BufferedInputStream(request.getInputStream());
InputStreamReader in = new InputStreamReader(request.getInputStream(),"UTF-8");
int i;
char c;
while ((i=in.read())!=-1) {
c=(char)i;
str.append(c);
}
}catch (Exception ex) {
ex.printStackTrace();
}
JSONObject obj= JSONObject.fromObject(str.toString());
System.out.println(obj.get("operUser"));
request.getInputStream中文乱码解决方案相关推荐
- Spring MVC POST中文乱码解决方案
2019独角兽企业重金招聘Python工程师标准>>> POST中文乱码解决方案 1.自己编写一个filter,来实现编码,代码如下: 1 public class Characte ...
- JSP中文乱码解决方案了解和TOMCAT中文乱码解决
java 中文乱码终极解决方案 首先,确保你的数据库是支持中文的.把数据库的编码方式设置能支持中文的,如GB2132,utf-8等,而且经过测试后确实能写入中文且正常显示.这样就就保证了数据库确实是支 ...
- iis 站点中文乱码 解决方案
iis 站点中文乱码 解决方案 参考文章: (1)iis 站点中文乱码 解决方案 (2)https://www.cnblogs.com/zhaokunbokeyuan256/p/10001726.ht ...
- Spring RestTemplate中文乱码解决方案
Spring RestTemplate中文乱码解决方案 参考文章: (1)Spring RestTemplate中文乱码解决方案 (2)https://www.cnblogs.com/accesski ...
- python写入csv文件中文乱码解决方案
python写入csv文件中文乱码解决方案 参考文章: (1)python写入csv文件中文乱码解决方案 (2)https://www.cnblogs.com/vsivn/p/6115537.html ...
- Windows 10 powershell 中文乱码解决方案
Windows 10 powershell 中文乱码解决方案 参考文章: (1)Windows 10 powershell 中文乱码解决方案 (2)https://www.cnblogs.com/we ...
- POST中文乱码解决方案
2019独角兽企业重金招聘Python工程师标准>>> POST中文乱码解决方案 ? Spring Web MVC提供了Filter用于解决POST方式造成的中文乱码问题,具体配置 ...
- PHP——PHP读取MySQL数据库中文乱码解决方案
问题描述 PHP读取MySQL数据库中文乱码 解决方案 静态页面 <head> <metahttp-equiv="Content-Type"content=&q ...
- mysql中文乱码解决方案_Mysql中文乱码解决方案
Mysql中文乱码解决方案 时间:2017-07-11 来源:华清远见JAVA学院 中文乱码问题一直是我们编程过程中比较常见又让人头疼的问题,但是只要按照标准进行配置,就能很好的避免出现中文乱 ...
最新文章
- SQLite与pandas
- input标签加disabled属性后无法获得其value值
- [转]PowerDesigner使用
- spoj 	Help the Military Recruitment Office!
- SS CMS 全新跨平台 V7.0 版本正式发布
- python读取txt文件_python实现读写txt文件的几种方法
- mysql ssh .net_c# – 使用SSH.NET库与MySQL建立SSH连接
- 改变外观_“改”出来的精彩!盘点5种改变葫芦外观的技艺
- 保姆级My SQL-5.7.19安装教程
- .Net中的事件处理模型
- Mybaits 3.2.6设计的一个缺陷,欢迎拍砖交流
- zoj 3640 Help Me Escape (概率dp 递归求期望)
- 正在启动文档服务器,正在启动远程服务器
- MySql学习笔记(六):扫描范围
- 图像直方图均衡 matlab,图像直方图均衡化
- 计算机组装与维修要学哪些,计算机组装与维修教学基本要求
- 非因解读 | Multiplex immunofluorescnece-多重免疫荧光结合单细胞蛋白组技术探索肿瘤微环境
- 基于Wiki的知识共享平台模型架构
- 中国石油大学《微观经济学》第一次在线作业
- 2022年考研计算机组成原理_4 指令系统
热门文章
- Java 11 将至,不妨了解一下 Oracle JDK 之外的版本
- 快来了解下Snappy Ubuntu是什么
- Android 多模块项目入门
- RobotLegs框架解析
- 问题以及发现问题和解决问题
- 开源软件 Cachet 被曝RCE漏洞
- 不小心发现谷歌 Firebase 消息服务的漏洞,获奖3万+美元
- spring boot 2.0.3+spring cloud (Finchley)6、配置中心Spring Cloud Config
- 北京正研究“车路协同”模式,将打造自动驾驶测试专用道路
- 2016打算做运维的人员必知必晓的知识