简体   繁体   English

gsp 编码不再适用于 grails 4.0.11?

[英]gsp encoding no longer working in grails 4.0.11?

Since upgrading an existing application from grails 4.0.3 to 4.0.11 (did not perform interim upgrades, so issue may be somewhere in there) my gsp's that contain raw HTML are now over-encoded (meaning they are showing text like <p>Hello</p> ).由于将现有应用程序从 grails 4.0.3 升级到 4.0.11(未执行临时升级,因此问题可能出在某处)我的包含原始 HTML 的 gsp 现在被过度编码(意味着它们显示的文本如<p>Hello</p> )。 Is anyone else having this problem?还有其他人有这个问题吗? Was there an encoding change that missed documentation (or that I overlooked)?是否有编码更改遗漏了文档(或者我忽略了)?

I have my encodings set to:我的编码设置为:

grails {
    // other stuff removed for clarity here

    converters.encoding = "UTF-8"

    views {
      "default" {
        codec = "none"
      }
      gsp {
        encoding = "UTF-8"
        htmlcodec = "xml"
        codecs {
          expression = "none"
          scriptlets = "none"
          taglib = "none"
          staticparts = "none"
        }
      }
    }
}

Other info that may help:其他可能有帮助的信息:

  • This only happens when running as a jar;这仅在作为 jar 运行时发生; with run-app encoding is respected as usual像往常一样使用run-app编码

Filing grails bug to report this;提交 grails 错误以报告此问题; minimal reproducible example is available here: https://github.com/danduke/encoding-test此处提供了最小的可重现示例: https://github.com/danduke/encoding-test

Issue report here: https://github.com/grails/grails-core/issues/12019在这里发布报告: https://github.com/grails/grails-core/issues/12019

EDIT April 2022: The issue report has a workaround now.编辑 2022 年 4 月:问题报告现在有解决方法。 Thanks to @ascheidmeir!感谢@ascheidmeir!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM