我从 GitHub (https://github.com/henrikengstrom/roygbiv) 下载了多模块 Scala 项目,其中一个模块是 Play 2.0 模块。所以我可以使用 SBT 的 run
运行整个应用程序每个模块上的命令,一切正常。但是当我添加到 Play 2.0 模板( index.scala.html
)非英文字符并在浏览器中按 F5 时,我得到编译错误:
IO error while decoding C:\Users...\web\target\scala-2.9.1\src_managed\main\views\html\index.template.scala with UTF-8 Please try specifying another one using the -encoding option
Play 2.0 模块我也使用 SBT 的
run
运行命令,不使用 Play
安慰。我检查了源文件编码 - 它是 UTF-8。还尝试了没有 BOM 的 UTF-8。
哪里可能有问题?
最佳答案
您可以尝试使用强制编码为 UTF-8 来启动 SBT。我读到了 post对于某些人来说,它有助于通过以下选项启动 SBT:
JAVA_TOOL_OPTIONS='-Dfile.encoding=UTF8'
然后 SBT 的第一行应该显示:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
关于斯卡拉玩 2.0。编译错误: IO error while decoding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16529753/