Batch UTF-8 Converter
简体中文
A VS Code extension for batch-converting selected files or files inside selected folders to UTF-8.
Features
- Batch conversion from the Explorer context menu for selected files or folders.
- Multi-select support for files and folders, with recursive processing.
- Extension filtering with both blacklist and whitelist modes.
- Menus, settings descriptions, notifications, and logs follow the current VS Code display language automatically.
- BOM detection, valid UTF-8 detection, and heuristic candidate-encoding detection.
- Skips likely binary files, symbolic links, and open unsaved files.
Usage
- Open this extension project in VS Code.
- Press
F5 to launch the Extension Development Host.
- In the new window, select files or folders in Explorer.
- Right-click and run
Batch Convert to UTF-8 or its localized menu title.
Configuration
Search for batchUtf8 in Settings:
batchUtf8.mode
blacklist: Skip files whose extensions match the configured list.
whitelist: Only process files whose extensions match the configured list.
batchUtf8.extensions
- Extension rules used by the filter.
- Supports values such as
.ts, ts, and .d.ts.
batchUtf8.candidateEncodings
- Candidate encodings used by heuristic detection.
- Defaults to
utf-16le, utf-16be, gb18030, gbk, big5, shift_jis, euc-jp, euc-kr, and windows-1252.
Internationalization
- Explorer menu titles and command palette entries are localized by VS Code extension manifest localization.
- Setting descriptions are also localized by VS Code and follow the current VS Code UI language.
- Runtime notifications, progress messages, and output logs follow the current VS Code display language automatically.
Notes
- Converted files are written back as UTF-8 without BOM.
- Files whose encoding cannot be identified reliably are left unchanged and logged as failures.
- The default blacklist excludes common binary extensions. If your project contains unusual text extensions, whitelist mode is safer.
| |