Skip to content

[1289] 导出样式文件/包宏名称使用 utf8->herk 修复中文乱码 - #4530

Open
da-liii wants to merge 2 commits into
mainfrom
da/1289/export_ts
Open

[1289] 导出样式文件/包宏名称使用 utf8->herk 修复中文乱码#4530
da-liii wants to merge 2 commits into
mainfrom
da/1289/export_ts

Conversation

@da-liii

@da-liii da-liii commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

描述

打开标题或文件名是中文的 .tmu 文件时,使用「工具 → 宏命令 → 导出样式包」或「导出样式文件」新建的标签头部宏名称会出现乱码。

根因

extract-source-title 中通过 (url-basename (current-buffer)) 获得的文件名为原始 UTF-8 字符串,而内部文档树排版要求文本节点使用 Herk 编码(中文为 <#XXXX> 转义)。未转换的原始 UTF-8 字节直接拼入文档树导致头部被当作单字节字符渲染出现乱码。

解决

extract-source-title 中使用 (utf8->herk (url-basename (current-buffer))),确保生成的宏名称符合 Herk 编码契约。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant