当前位置:网站首页>设置cmd的编码为utf-8
设置cmd的编码为utf-8
2022-06-28 08:06:00 【庸懒】
最近初学数据库,发现不管是插数据还是查数据只要是用到中文的都是乱码,刚开始是很疑惑的因为我的数据库已经设置格式为utf-8,查了半天才知道是因为cmd的编码没改过来,下面我就说一下设置cmd默认格式为utf-8
一、非默认形式
- 首先在控制台输入chcp可以查看当前代码页为936,也可以右键cmd然后点击属性中的选项中查看到。这里因为我已经设置过了所以我用mysql的窗口做演示。

- 直接在cmd输入chcp 65001即可,这时的cmd就设置为utf-8的形式了。但是这种更改仅限本次cmd窗口,如果关闭了cmd再打开你会发现代码页还是936,所以像我这样的懒人就会将utf-8格式改为默认。
二、设置utf-8为默认
1.首先打开运行窗口输入regedit打开注册表编辑器。

2.按以下路径进入到目标项
计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor
强烈建议大伙直接复制粘贴进入嗷,懒就得懒到底。
3.右键右边区域,点击新建选择字符串值然后新建如下选项
然后点击确定就OK了,这时候你再打开cmd就会发现默认代码页已经变成65001了。
边栏推荐
- Jenkins' common build trigger and hook services (V)
- Kubernetes cluster command line tool kubectl
- Es data export CSV file
- Estimation of SQL execution cost by MySQL query optimizer
- Software testing and quality final review
- Redis implements distributed locks
- Upgrade HDP spark to spark 2.4.8 without upgrading ambari
- Devops foundation chapter Jenkins deployment (II)
- ZYNQ_ IIC read / write m24m01 record board status
- Ambari (VI) -- ambari API use
猜你喜欢
随机推荐
Co process, asyncio, asynchronous programming
Explanation and application of instr() function in Oracle
asp. Net datalist when there are multiple data displays
SOC serial port configuration
Es data export CSV file
Section 5: zynq interrupt
同花顺注册开户靠谱吗?安全吗?
HJ整数与IP地址间的转换
Prometheus monitoring (I)
LeetCode之三步问题
Redis uses sentinel master-slave switching. What should the program do?
HJ进制转换
小艺人黄鑫洋受邀参加巴黎时装周儿童单元武汉站
Kubernetes theoretical basis
【js】-【DFS、BFS应用】-学习笔记
Soft exam -- software designer -- afternoon question data flow diagram DFD
Software design of resistance test board
Introduction to Devops Basics
HJ字符串排序
HJ prime factor









