quanshiyinian 发表于 2020-12-12 09:18:34

sublime text3 如何设置文件编码默认为utf-8的方法

很多朋友在使用sublime的的时候都有可能遇到文件编码格式不是utf-8的情况,导致文件乱码,因此呢,我们就需要将utf-8设置为默认文件编码格式。       在此呢,不再赘述何为文件编码啦,需要了解的朋友可自行百度查询学习、了解。现在呢我们就好开始来设置啦,为了简单起见,请看图片所示即可。打开Setting-Default,在页面中输入如下代码:{
    // supported encoding list, name & code in pair
    "encoding_list" : [
      ["Chinese Simplified (GBK)", "GBK"],
      ["Chinese Simplified (GB2312)", "GB2312"],
      ["Chinese Simplified (GB18030)", "GB18030"],
      ["UTF-8", "UTF-8"]
    ],    // Maximum size for encoding cache, 0 means no cache
    "max_cache_size" : 100,    // Maximum lines to detect, 0 means unlimited
    "max_detect_lines" : 600,    // Convert when previewing file: true or false
    "preview_action" :true,    // Encoding for new file, empty means using sublime text's "default_encoding" setting
    "default_encoding_on_create" : "UTF-8",    // Set this option to true will cause Sublime Text reload the saved file when losing focus
    "lazy_reload": true,    // The minimum confidence rate between 0.0 and 1.0
    "confidence": 0.95,    // Convert in Find Results view
    "convert_on_find": true,    // Convert when loading/saving a file
    "convert_on_load" : true,
    "convert_on_save" : true}最后一步,打开Setting-User,输入下面的代码。{
    "default_encoding": "UTF-8",
} 这样就可以了,是不是比较简单
页: [1]
查看完整版本: sublime text3 如何设置文件编码默认为utf-8的方法