当前位置:网站首页>PHP发送移动MAS短信乱码的解决方法
PHP发送移动MAS短信乱码的解决方法
2022-07-28 10:36:00 【hongdi】
使用命令:show variables like "%char%";
查看mysql数据库的字符编码:

2、php使用如下:
mysql_select_db('mas');
mysql_query("set names latin1;");
mysql_query(mb_convert_encoding("insert into api_mt_db01(mobiles,content)values('".$mobiles."','".$content."');", "GB2312","UTF-8"));
其中set names latin1等同于
SET character_set_client = latin1;
3、项目中的字符编码是UTF-8,运行环境是windows 2008 ,其字符编码是GB2312,
由于latin1和utf8字符集不兼容,转换不可逆,所以必须把utf8转成gb2312,再把GB2312转成latin1
边栏推荐
- GKLinearCongruentialRandomSource
- Causes and solutions of invalid ROM table
- Nodejs: detect and install the NPM module. If it is already installed, skip
- Apb2 and apb1 in stm32
- Arduino Basics
- Purchase, sale and inventory software suitable for small and medium-sized enterprises to solve five major problems
- Pyqt5 rapid development and practice 4.13 menu bar, toolbar and status bar and 4.14 qprinter
- Sword finger offer 30. stack containing min function
- Development environment configuration of nodemcu
- GKSphereObstacle
猜你喜欢

Redis-day01 common sense supplement and redis introduction

Sword finger offer 06. print linked list from end to end

盘点:144个免费学习网站,全网最全资源合集

Particle swarm optimization to solve the technical problems of TSP

Reading these six books makes learning MySQL easier

Blue Bridge Cup embedded Hal library ADC

Sword finger offer 30. stack containing min function
Advanced C language: pointer (1)

The future of generating confrontation networks in deepfake

Inventory: 6 books teach you the necessary skills for career promotion
随机推荐
Judge whether the nixie tube is a common anode or a common cathode
吊打面试官的问题
Install GMP
Here is a super practical excel shortcut set (common + summary of eight categories)
GKNoiseSource
网络文件系统服务(NFS)
Semeval 2022 | introducing knowledge into ner system, aridamo academy won the best paper award
If you don't climb mountains, you don't know the height of the sky; If you don't face deep streams, you don't know the thickness of the earth
Yan reports an error: exception message: /bin/bash: line 0: fg: no job control
Ten questions about low code: tell everything about low code!
Blue Bridge Cup embedded Hal library USART_ RX
Nodejs:mongodb 简单模糊+分页查询实例
做数据分析,你还不懂RFM分析方法(模型)?
GKSpheresNoiseSource
samba学习
Redis-day01 common sense supplement and redis introduction
学会这些分析方法及模型,遇到问题不再没思路
nodemcu之开发环境配置
I don't know how lucky the boy who randomly typed logs is. There must be a lot of overtime
GKRidgedNoiseSource