English | 中文
A transparent encoding conversion virtual filesystem. Mount a drive where legacy-encoded files (GBK, Shift_JIS, Big5...) appear as UTF-8 to any application.
透明的编码转换虚拟文件系统。挂载一个虚拟磁盘,让遗留编码文件(GBK、Shift_JIS、Big5...)在任何应用中显示为 UTF-8。
You have a legacy project with source files encoded in GBK. You want to use VSCode, Claude Code, or other modern tools, but they all default to UTF-8 and show garbled text.
encoding-vfs solves this simply:
- You have a GBK-encoded project directory, e.g.,
C:\projects\my-legacy-project - Run encoding-vfs to mount it as
Y:drive - Open
Y:\my-legacy-project\— all files appear as UTF-8 automatically - Open, edit, save with any tool — encoding conversion is fully transparent
- On save, content is converted back to GBK — original files stay GBK-encoded
# Mount
.\encoding-vfs.exe -b C:\projects\my-legacy-project -d Y
# Open Y:\my-legacy-project in VSCode
code Y:\my-legacy-projectEdit and save files normally in VSCode. VSCode sees UTF-8; the disk stores GBK.
# Mount
.\encoding-vfs.exe -b C:\projects\my-legacy-project -d Y
# Start Claude Code in the project
cd Y:\my-legacy-project
claudeAI tools read files as UTF-8; writes are converted back to GBK automatically.
# Mount
.\encoding-vfs.exe -b C:\projects\my-legacy-project -d Y
# Set up git wrapper (maps git commands to source directory)
set PATH=%CD%;%PATH%
# Use git normally
cd Y:\my-legacy-project
git status
git add .
git commit -m "fix: update"
git pushThe git wrapper automatically maps git commands to the source directory, ensuring .git operations happen in the right place.
Step 1: Install WinFsp (required)
encoding-vfs requires WinFsp for virtual drive mounting.
winget install WinFsp.WinFspOr download from https://winfsp.dev/releases/
Step 2: Download encoding-vfs
Download the latest zip from Releases and extract to any directory.
Step 3: Copy WinFsp DLL
copy "C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll" .\Copy winfsp-x64.dll to the same directory as encoding-vfs.exe.
# Install FUSE3
sudo apt-get install -y libfuse3-2 fuse3Download and extract the Linux version from Releases.
# Mount project to Y: drive
.\encoding-vfs.exe -b C:\projects\my-legacy-project -d Y
# The mount point has a subdirectory named after the source directory
dir Y:\
# -> my-legacy-project
# Access files through the subdirectory
dir Y:\my-legacy-project
type Y:\my-legacy-project\src\main.cppencoding-vfs keeps running after mounting. Press Ctrl+C to stop and unmount.
# Mount project to /mnt/vfs
./encoding-vfs -b /home/user/my-legacy-project -m /mnt/vfs
# Now you can access /mnt/vfs
ls /mnt/vfs
cat /mnt/vfs/src/main.cppUnmount: fusermount -u /mnt/vfs or press Ctrl+C.
| Option | Description | Default |
|---|---|---|
-b, --backend <dir> |
Source project directory (where original-encoded files are) | Required |
-d, --drive <letter|path> |
Windows drive letter or directory path | X |
-m, --mount <path> |
Linux mount point | /mnt/vfs |
-s, --source-encoding <enc> |
Source file encoding. auto uses default encoding, or specify encoding name |
auto |
-t, --target-encoding <enc> |
Encoding shown when mounted | UTF-8 |
-c, --config <file> |
Config file path | None |
-L, --log-level <level> |
Log level: trace/debug/info/warn/error | info |
GBK, UTF-8, Big5, Shift_JIS, EUC-JP, EUC-KR, ISO-2022-JP, KOI8-R, Windows-1252, UTF-16LE, UTF-16BE, etc.
In -s auto mode, the default encoding (usually GBK) is used as source encoding. Auto-detection between GBK and UTF-8 is unreliable, so explicit specification is recommended.
You can create a TOML config file instead of command-line arguments:
[backend]
backend_dir = "C:\\projects\\my-legacy-project"
[mount]
drive_letter = "Y"
[encoding]
source_encoding = "GBK"
target_encoding = "UTF-8"
default_encoding = "GBK"
[encoding.filter]
# Files that skip encoding conversion (raw bytes returned). .gitignore syntax.
rules = ["*.png", "*.exe", "*.dll", "*.jpg"]
# Files/directories completely hidden from mount point
hidden = [".git/", "node_modules/", "*.log"]
[log]
level = "info"
# file = "vfs.log" # Optional: output to fileUsage:
.\encoding-vfs.exe -c config.tomlrules: Matched files skip encoding conversion, returning raw bytes. Suitable for binary files.hidden: Matched files/directories are completely invisible at the mount point.- Syntax follows
.gitignore:*.pngmatches all pngs,dir/matches entire directory,!patternnegates. .git/is hidden by default.
When using git in the mounted directory, set up the git wrapper:
# Windows CMD (current session)
set PATH=%CD%;%PATH%
# Windows PowerShell (current session)
$env:PATH = "$PWD;$env:PATH"
# Permanent
setx PATH "%CD%;%PATH%"After setup, when you run git status, git commit, etc. in the mounted directory, the git wrapper automatically:
- Identifies the source project for the current directory
- Maps paths back to the source directory
- Executes the real git command in the source directory
This ensures .git operations always happen in the correct location, avoiding issues from encoding conversion.
- Virtual root directory: Mount point now contains a subdirectory named after the source project (e.g.,
Y:\my-project\), avoiding permission issues at the drive root - Windows ACL support: Enabled
persistent_aclsand proper security descriptor handling — right-click "New File" and other shell operations now work correctly - Fixed ripgrep/VSCode search: Fixed
read_directorymarker handling that caused file listing to skip all entries after./.., making ripgrep and VSCode file search work properly - Reduced log noise: Changed per-operation logs from
infotodebuglevel
- Added mounts.json registry for tracking active mounts
- Added git wrapper with automatic path mapping via mounts.json
- Added
.gitignore-style filter syntax (replacing@passthroughprefix)
A: Make sure you're using the latest version (v0.3.0+). Older versions had bugs in chunked read encoding conversion and directory listing pagination.
A: Auto-detection between GBK and UTF-8 is very unreliable — they share many overlapping byte sequences. Explicitly specifying the source encoding is recommended. If your project has mixed encodings, that's not currently supported — unify encodings first.
A: WinFsp is the Windows File System Proxy framework that encoding-vfs uses to implement virtual drives. Required on Windows.
A: For large files (>500KB), each read converts the entire file and caches it. First read is slightly slow; subsequent reads are fast. Writes also convert the full content before saving. No noticeable delay in daily use.
A: Yes. Use different drive letters for each:
.\encoding-vfs.exe -b C:\projects\project1 -d Y
.\encoding-vfs.exe -b C:\projects\project2 -d ZMIT