file application-prod.properties
application-prod.properties: Unicode text, UTF-8 text, with no line terminators
# 生产环境
# 生产环境
案例2:选中’Transparent native-to-ascii conversion’选项在IDEA、sublime查看无任何变化
案例3:选择GBK编码,选中’Transparent native-to-ascii conversion’
file application-prod.properties
application-prod.properties: Unicode text, UTF-8 text, with no line terminators
# 鐢熶骇鐜
# 生产环境
案例4:选择GBK编码,同时取消选中’Transparent native-to-ascii conversion’
file application-prod.properties
application-prod.properties: Unicode text, UTF-8 text, with no line terminators
# 鐢熶骇鐜
# 生产环境
file application-test.properties
application-test.properties: ASCII text, with no line terminators
# 测试环境
# \u6D4B\u8BD5\u73AF\u5883
案例2:取消选中’Transparent native-to-ascii conversion’选项
file application-test.properties
application-test.properties: ASCII text, with no line terminators
# \u6D4B\u8BD5\u73AF\u5883
# \u6D4B\u8BD5\u73AF\u5883
案例3:选择GBK编码,选中’Transparent native-to-ascii conversion’
file application-test.properties
application-test.properties: ASCII text, with no line terminators
# 测试环境
# \u6D4B\u8BD5\u73AF\u5883
案例4:选择GBK编码,同时取消选中’Transparent native-to-ascii conversion’
file application-test.properties
application-test.properties: ASCII text, with no line terminators
# \u6D4B\u8BD5\u73AF\u5883
# \u6D4B\u8BD5\u73AF\u5883
file application-uat.properties
application-uat.properties: ISO-8859 text, with no line terminators
# 预发布环境
# Ô¤·¢²¼»·¾³
总结:properties文件的编码和存储格式在创建时已经确定,后续在IDEA中对属性的修改只是修改了IDEA对文件显示的渲染,并不影响文件的本质
BOM问题可以通过查看二进制格式通过魔数查看
hexdump -C application.properties