当前位置:网站首页>When MySQL inserts Chinese into the database, there is a diamond question mark garbled code
When MySQL inserts Chinese into the database, there is a diamond question mark garbled code
2022-07-03 07:01:00 【CSDN Q & A】
1、 The phenomenon and background of the problem
Appears when the database is inserted �� The statement
2、 Problem related code , Do not paste screenshots
for (DetectionFlowBinding flowBinding : bindingList) { task = new PcrTask(); BeanUtils.copyProperties(operatorData, task); task.setDetectionItemName(new String(operatorData.getDetectionItemName().getBytes(StandardCharsets.UTF_8))); task.setFlowId(flowBinding.getFlowId()); task.setFlowName(detectionFlow.getFlowName()); task.setFlowNodeId(flowBinding.getNodeId()); task.setFlowNodeName(new String(flowBinding.getNodeName().getBytes(StandardCharsets.UTF_8))); task.setContainsParam(flowBinding.getContainsParam()); task.setSampleId(operatorData.getId());// Sample the primary key of this table id task.setCreateBy(param.getCreateBy()); task.setCreateTime(new Date()); operatorTaskList.add(task); }3、 adopt mybatis plus Automatically generate code and batch insert
4、DetectionItemName FlowName These two fields occasionally appear in Chinese +� The combination of garbled
5、 It is normal to read Chinese in the log before inserting , Look at Alibaba cloud sql Auditing is also normal , Saving to the database is garbled
notes :mysql8.0 edition
Take the answer :
Look at you mysql Is the character set of the database utf8
边栏推荐
猜你喜欢

2022-06-23 VGMP-OSPF-域间安全策略-NAT策略(更新中)

Software testing learning - day one

The 10000 hour rule won't make you a master programmer, but at least it's a good starting point

Arctic code vault contributor

In depth analysis of reentrantlock fair lock and unfair lock source code implementation

Ruoyi interface permission verification
![[untitled]](/img/72/4ff9354634342580a135debb58b60e.jpg)
[untitled]

Daily question brushing record (11)

机器学习 | 简单但是能提升模型效果的特征标准化方法(RobustScaler、MinMaxScaler、StandardScaler 比较和解析)

每日刷题记录 (十一)
随机推荐
【code】偶尔取值、判空、查表、验证等
Win 10 find the port and close the port
[untitled]
这两种驱蚊成份对宝宝有害,有宝宝的家庭,选购驱蚊产品要注意
[attribute comparison] defer and async
Machine learning | simple but feature standardization methods that can improve the effect of the model (comparison and analysis of robustscaler, minmaxscaler, standardscaler)
File links cannot be opened or downloaded in Google browser
UTC时间、GMT时间、CST时间
php artisan
C2338 Cannot format an argument. To make type T formattable provide a formatter<T> specialization:
Pits encountered in the use of El checkbox group
vmware虚拟机C盘扩容
Ruoyi interface permission verification
Jmeter+influxdb+grafana of performance tools to create visual real-time monitoring of pressure measurement -- problem record
Selenium key knowledge explanation
[classes and objects] explain classes and objects in simple terms
Class and object summary
Getting started with pytest
机械观和系统观的科学思维方式各有什么特点和作用
Unit test framework + Test Suite