Eclipse 不会使用动态字符集保存 html 文件

Eclipse won't save html file with dynamic charset

我正在使用 Thymeleaf 模板引擎,并希望从我的项目属性中获取头块上元标记的字符集属性值,即:
<meta th:charset="${@environment.getProperty('html.charset')}">

但是当我想保存我的 html 文件时,我得到了这个弹出错误:

Save could not be completed. Try File > Save As... if the problem persists.
Reason:
Character encoding "${@environment.getProperty('html.charset')}" is not a legal character encoding.

我什至尝试从 eclipse 外部保存文件,但是当回到 eclipse 并想要打开文件时,我无法访问它并收到此错误:

Unsupported Character Encoding
Character encoding "${@environment.getProperty('html.charset')}" is not supported by this platform.
Set Encoding...

我试图在 eclipse 首选项中暂停所有验证器,但这并没有解决问题。

任何帮助的想法?提前致谢。

我正在使用 Mac OS 并为企业 Java 和 Web 开发人员使用 Eclipse IDE,版本:2021-09 (4.21.0)。

无论前缀如何,正在使用字符集值来正确读取和写入文件。无前缀 meta 标签中的属性有前缀是正常编码检测应忽略它的线索。为此请开一个bug report

对于解决方法,使用文件的 Properties 对话框的 Resource 页面强制使用您想要的编码(通过正确的方式到达那里-单击文件)。