MrWeiCodes/dsh-fs-encoding
为 DeepSeek Harness(DSH)提供文件编码守护:让 AI 读写 GBK 等非 UTF-8 文件和带 BOM 的文件时不会弄坏编码
Project Overview项目介绍
This is a native file encoding management plugin built exclusively for DeepSeek Harness (DSH). It addresses a core limitation of DSH’s native file tools, which only support UTF-8 and often corrupt legacy project files with non-UTF-8 encodings or BOM headers. The plugin replaces DSH’s native read, write, and edit tools while retaining all original DSH security features, including sandboxing, version checking, and post-read write protection. To install via the recommended npm method, run the command dsh plugin --profile web add dsh-fs-encoding and restart dsh web after installation completes.
The plugin preserves byte-level fidelity: any file’s original encoding and BOM status is retained after edits, so a GBK file remains a GBK file after any modification by DSH’s AI. If the target encoding cannot represent new content added by AI, the plugin rejects the write request entirely instead of writing garbled characters that permanently corrupt the file. It is designed specifically for developers working on legacy projects that use region-specific encodings like GBK, Big5, or Shift-JIS. By default, it asks users or AI to confirm ambiguous encoding candidates to prevent incorrect guesses that damage files.
The plugin is released under the permissive MIT open source license, and supports 19 common encodings, with Windows-1258 Vietnamese excluded due to limitations of the underlying encoding library. Configuration can be done via a simple YAML file or environment variables, with options to toggle auto-guessing, adjust the list of candidate encodings, and set the maximum allowed file size. It does not modify DSH core code, and uninstalling it immediately restores the original native tools to their original state. It conflicts with any other plugin that registers the same read/write/edit tools on the same DSH scope layer.
dsh-fs-encoding是专门为DeepSeek Harness(DSH)开发的原生文件编码治理插件,用于解决DSH原生文件工具仅支持UTF-8编码、无法正确处理旧项目常见非UTF-8编码的问题。它接管DSH原生的read、write、edit三个核心文件工具,在保留原生所有安全机制与原有行为的前提下,实现非UTF-8编码文件和BOM的正确读写,始终保证文件修改后仍保留原有编码格式。
面向需要处理包含东亚多语言编码的 legacy 项目开发者,默认模式下遇到无BOM非UTF-8文件会列出候选编码供人工或AI选择,宁可失败也不猜错,避免文件被静默损坏。用户也可以开启自动猜测编码模式,让插件自动处理可明确识别的非UTF-8文件,插件不支持编码转换,严格保证不会破坏原有文件编码。
本插件采用MIT许可免费开源,共支持十九种常见编码,覆盖全系列Unicode、东亚各语言主流编码和全系列Windows ANSI编码,目前暂不支持越南语Windows-1258编码。安装方式灵活,提供四种安装方式,支持配置文件和环境变量自定义参数,安装完成后需要重启dsh web才能生效。
请帮我安装这个 DSH 插件。安装前先完成【兼容性检查 + 安全性检查】,检查通过再动手。
插件:dsh-fs-encoding(MrWeiCodes/dsh-fs-encoding)
仓库:https://github.com/MrWeiCodes/dsh-fs-encoding
本站详情页:https://www.yhbd.top/plugins/mrweicodes-dsh-fs-encoding/
本站登记:类型 plugin · 归类 原生 DSH 插件 · 许可证 MIT · ⭐ 6 · 最近提交 2026-09-28 · 主语言 TypeScript
按下面顺序执行,每步先把结论告诉我,再进入下一步:
【1 兼容性检查】
① 我这边:DSH 版本、Node 版本、操作系统、当前 profile(web / desktop)。
② 读它的 README、package.json、插件 manifest,列出它要求的 DSH 版本 / Node 版本 / 操作系统 / 外部依赖 / 需要另外先装的运行时。
③ 逐条比对,结论只写「满足 / 不满足 / 未知」三种;不满足的给出可行替代方案。
④ 检查是否和我已装的插件冲突:命令名重复、skill / tool 重名、端口占用、重复注册的 MCP server。
【2 安全性检查】
① 仓库可信度:和上面「本站登记」是否一致;star / fork 数、创建时间、最近提交,是否归档或长期停更。
② 安装脚本:逐行看 package.json 的 preinstall / install / postinstall,以及 install.sh、setup.ps1 之类脚本。出现 curl|bash、下载后直接执行、混淆代码、访问与插件功能无关的域名,立刻停下来告诉我,不要继续装。
③ 依赖:列出新增依赖,标出无人维护、或与知名包拼写近似的可疑包(typosquatting)。
④ 权限与副作用:它会读写哪些目录、访问哪些域名、需要哪些 DSH 权限(filesystem / network / shell / clipboard 等),以及怎么卸载和回滚。
⑤ 如果它要求 sudo / 管理员权限,或权限明显超出功能所需,先停下来问我。
【3 安装】
上面两步没有「不满足」和「高危项」时才执行;用官方推荐方式安装,不要自行提权。
【4 汇报】
用表格输出:检查项 / 结论 / 依据 / 是否需要我决策。拿不准的一律写「未知」并说明要我怎么确认——不要猜,也不要替我决定。
Send this message to DSH in your current session: it verifies compatibility and security first (answering met / not met / unknown item by item) and only installs once everything checks out — it will stop and ask you if it finds a high-risk item. The box scrolls; the copy is the full prompt. CLI install commands may not be accurate across systems, so DSH is the safer route.把上面这条消息直接发给当前会话里的 DSH:它会先核对兼容性与安全性(逐条给「满足 / 不满足 / 未知」),确认没问题再安装,有高危项会停下来问你。框内可滚动,复制到的是完整提示词;安装命令不一定准确,发给 DSH 更稳。
- Only 6 stars - very few users, little community feedback星标只有 6,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项
Compatibility兼容性
- DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
- External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
- Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册
Security安全性
- Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
- Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
- curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
- Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
- Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
- Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式
Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。
Or use CLI install (for developers)或使用命令行安装(适合开发者)
CLI Install命令行安装
dsh plugin --profile web add dsh-fs-encoding
把 MrWeiCodes/dsh-fs-encoding 加入你的 DSH 配置(web profile)即可启用。
READMEREADME
dsh-fs-encoding — DSH 文件编码守护
为 DeepSeek Harness(DSH)提供的文件编码治理插件:让 AI 读写文件时不再弄坏 BOM 与多字节编码
🌏 中文 | English
dsh · dsh-plugin · plugin · encoding · BOM · GBK · Big5 · Shift-JIS · UTF-16 · AI agent · 编码 · 文件编码 · 乱码
简介
DSH 自带的 read / write / edit 三个文件工具只认 UTF-8,遇到中文、日文、韩文项目里常见的编码就会出问题:
- GBK、Big5、Shift-JIS 等编码的文件根本读不了,直接报
invalid UTF-8 text,AI 只能干看着; - 带 BOM 的 UTF-8 文件能读,但 BOM 会被悄悄吃掉——AI 随手改一次,文件开头那三个字节就没了。对 PHP、旧版编译器、部分 Windows 软件来说,文件头少了 BOM 就可能解析出错或直接乱码;
- 更麻烦的是没有任何警告:你只会在某天发现文件坏了,却不知道是哪次编辑弄坏的。
本插件接管这三个工具,在完整保留原有行为(沙箱围栏、读后写保护、版本校验、diff 展示)的前提下,让非 UTF-8 文件和 BOM 都能正确读写:文件原来是什么编码,改完还是什么编码。
功能特性
- 字节级保真:文件编码在首次读取时确定一次,之后每次保存都按原编码写回。改一个 GBK 文件,它仍然是一个 GBK 文件,不会被偷偷转成 UTF-8。
- BOM 保真:原本有 BOM 就精确还原,原本没有就绝不擅自添加——两个方向都不会出错。
- 换行符保真:CRLF / LF / CR 在读取时识别、保存时还原,Windows 项目不会被改成 LF。
- 绝不静默损坏:如果目标编码表示不了新内容(比如往 GBK 文件里写 emoji),插件会直接拒绝写入并说明原因,文件保持原样——而不是写进去一堆
?把文件毁掉。 - 读不了会告诉你怎么办:遇到非 UTF-8 文件时,插件会列出最可能的几种编码和各自的解码效果,AI(或你)选一个重新读即可,就像 VS Code 的「通过编码重新打开」。
- 十九种编码:UTF-8(含 BOM)、UTF-16、UTF-32,以及 GBK、Big5、Shift-JIS、EUC-KR 和 Windows-125x 全系(西欧、中欧、西里尔、希腊、土耳其、希伯来、阿拉伯、波罗的海)。
- 零学习成本:
read/write/edit三个工具的参数、返回格式与原版完全一致,是直接替换,原有提示词和工作习惯都不用改;read和write各多了一个可选的encoding参数(write的只用于新建文件,见下)。 - 能建指定编码的新文件:
write加一个encoding就能直接生成 GBK、Shift-JIS 等编码的文件,不用先写 UTF-8 再转码。 - 多三个工具:
insert(按行号插入,原生没有这个能力)、undo_last_edit(撤销上一次编辑,内容与编码一并还原)和str_replace_editor(4 个子命令的兼容层,同样带编码治理)。见下方「另外三个工具」。 - 配置简单:一个 YAML 文件,几项开关,都能用环境变量覆盖。
使用
开箱即用
装好就能用,不需要任何配置。 插件没有必填项、没有初始化步骤,也不会改动你的项目——装上之后,AI 照常用 read / write / edit,编码的事插件自己处理:
- 读 UTF-8 文件(含带 BOM 的):和原版完全一样,BOM 不会再被吃掉。
- 读带 BOM 的 UTF-16 / UTF-32 文件:自动识别。
- 改 GBK、Shift-JIS 等老编码文件:按原编码写回,不会被悄悄转成 UTF-8。
- 写新文件:默认 UTF-8,需要别的编码时加一个参数即可。
这些都不需要你做任何事,也不需要 AI 改调用习惯。日常使用中,AI 的调用方式与原版完全一致。
AI 的调用区别
只有一种情况会不一样:无 BOM 的非 UTF-8 文件(典型是 GBK / Big5 / Shift-JIS 的老文件)。此时插件不会擅自猜,而是停下来让 AI 用显式编码重读一次:
Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →
titanwings/distilly
YuJunZhiXue/dsh-purge
Clearailhc/clearai-dsh
yejiming/MuseAI
superdesigndev/superdesign-skill