'编码说明'
This commit is contained in:
parent
3b045ea424
commit
9189d45000
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
|
|
@ -0,0 +1,30 @@
|
||||||
|
# 关于文件编码的约定
|
||||||
|
|
||||||
|
## Java文件
|
||||||
|
|
||||||
|
Java文件均用`UTF-8`编码。
|
||||||
|
|
||||||
|
IDEA配置:`File -> Settings -> Editor -> File Encodings`,将`Global Encoding`与`Project Encoding`都设为`UTF-8`。
|
||||||
|

|
||||||
|
|
||||||
|
## Maven工程
|
||||||
|
|
||||||
|
Maven工程下设置,可以通过`pom.xml`文件配置`properties`。限制项目文件编码。
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
|
||||||
|
</properties>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 前端文件
|
||||||
|
|
||||||
|
前端文件均用`UTF-8`编码。
|
||||||
|
|
||||||
|
## 数据库编码
|
||||||
|
|
||||||
|
MySQL采用`UTF8mb4`编码,该编码需要`MySQL5.5`以上版本才支持,且`MySQL8`以上版本才成为默认编码。因此当`MySQL`版本在8以下的版本,需要注意在配置文件中配置其编码。
|
||||||
|
|
||||||
|
PostgreSQL采用默认的`UTF-8`编码。
|
||||||
Loading…
Reference in New Issue