asciidoc - Spring REST Docs:非英文字符串在自定义片段表列中不起作用
问题描述
我为 response-fields.adoc 定义了一个自定义片段模板,以包含一个附加列,在该列中我使用中文字符作为该新列的名称。问题是生成的代码段没有以正确的中文字符显示列名,尽管列中的数据以中文正确显示。
我的 response-fields.snippet 文件以 UTF-8 编码。
这是我的自定义代码段模板:
|===
|Field|Type|Description|中文描述
{{#fields}}
|{{path}}
|{{type}}
|{{description}}
|{{description_zh_tw}}
{{/fields}}
|===
预期生成的片段:
|===
|Field|Type|Description|中文描述
|responseStatus
|String
|ID of the team.
|測試
|infected
|String
|ID of the team.
|測試
|fileName
|String
|ID of the team.
|測試
|===
实际生成的片段:
|===
|Field|Type|Description|銝剜��膩 <==== encoding problem?
|responseStatus
|String
|ID of the team.
|測試
|infected
|String
|ID of the team.
|測試
|fileName
|String
|ID of the team.
|測試
|===
解决方案
将代码段模板的编码从UTF-8更改为Big5可解决问题。
推荐阅读
- magento2 - Magento 2 beforeSaveAddressInformation 插件怎么做
- rust - 为本地泛型类型实现外部特征
- node.js - “npm 错误!” 运行 React 应用程序或找到 npm 版本时
- tfs - 是否可以从两个项目 azure DevOps 运行查询?我怎样才能做到这一点?
- html - 使用正则表达式在 html 标签之间拉取值
- python - 如何从,里面,用beautifulsoup?
- mysql - 有人可以解释设置 MYSQL 服务器的时区吗?
- c - 编写重复性 gdb 作业的脚本
- cockpit - 区域覆盖当前的生产环境
- r - 绘图背景的人类色谱