1、首先添加依赖
com.googlecode.juniversalchardet juniversalchardet 1.0.3
2、案例操作 Listdto = Mapper.get1("1643424790527_3F200045"); for (Dto to : dto) { byte[] jsondata = to .getJsondata();//实体属性为byte[],对应的是数据库字段类型blob UniversalDetector detector = new UniversalDetector(null); detector.handleData(jsondata, 0, jsondata.length); detector.dataEnd(); String encoding = detector.getDetectedCharset(); detector.reset(); System.out.println(encoding);//得到数据编码格式 }



