The vscode extension for convert the GBK related encoding to UTF8. have the feature of batch convert file encoding.
Open vscode and type ctrl + p
, type ext install buuug7.GBK2UTF8
, or search the extensions market with gbk, gbk
utf8 keywords.
When open the file with the GBK related(GB2312, GB18030, ...) encoding from vscode, it will show a prompt dialog suggest converting it. Or you can be manual convert it with the Convert encoding to UTF8 commander from the Command palette.
Also, you can select multiply files in the left file explore tree, or select folder, right click and select the ** Convert encoding to UTF8** item from context.
Selected multiply files in the left file explore tree, or select folder, right click and select the Convert encoding
to UTF8 item from context. Note that if you select more than one folder at a time, only the files in the first folder will be converted. The conversion result report file will be generated by default during batch conversion. You can disable this behavior by setting gbk2utf8. showBatchReport: false
The detected encoding is use the library of jschardet, support traditional and simplified Chinese encoding below.
Big5
GB2312
GB18030
EUC-TW
HZ-GB-2312
ISO-2022-CN
The GBK2UTF8.autoDetect
is set to true
default, if you want to disable the autoDetect GBK related files,
set false
in the user and workspace settings under Extensions -> GBK2UTF8 section.
{
"GBK2UTF8.autoDetect": true
}
The GBK2UTF8.ignoreExtensions
is set to git,ts,vue
default, if you want add more ignore file extensions, please set
it separated by comma in the user and workspace settings under Extensions -> GBK2UTF8 section.
{
"GBK2UTF8.ignoreExtensions": "git,ts,vue"
}
The GBK2UTF8.ignoreDir
is set to node_modules,.vscode,.idea,.vscode-test,.github
default, if you want add more
ignore directory, set it separated by comma in the user and workspace settings under Extensions -> GBK2UTF8 section.
{
"GBK2UTF8.ignoreDir": "node_modules,.vscode,.idea,.vscode-test,.github"
}
The GBK2UTF8.showBatchReport
is set to true
default, show convert report result when batch convert encoding, show
convert report result.
{
"GBK2UTF8.showBatchReport": true
}
please reload the window
after the settings is being change, make sure the setting are take effect.
If you're interested in contributing to, fork the repo and submit pull requests.