Error Io Error While Decoding With Utf-8 Scala
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have io error while decoding main.scala with utf-8 Meta Discuss the workings and policies of this site About Us
Io Error While Decoding With Utf 8 Play
Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with
Please Try Specifying Another One Using The -encoding Option
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers,
Scalac Classpath
just like you, helping each other. Join them; it only takes a minute: Sign up Scala Play 2.0. Compilation error: IO error while decoding up vote 10 down vote favorite I downloaded multi-module Scala project from GitHub (https://github.com/henrikengstrom/roygbiv), and one of the module is Play 2.0 module. So I can run whole application using SBT's run command on each module, and all works fine. But when I add to Play 2.0 template (index.scala.html) non-English characters and press F5 in browser I get compilation error: 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 module I run also using SBT's run command, not using Play console. I checked source file encoding - it is UTF-8. Also tried UTF-8 without BOM. Where can be problem? scala playframework playframework-2.0 sbt multi-module share|improve this question edited Jun 13 '13 at 8:19 asked May 13 '13 at 19:33 MyTitle 2,4702083173 opened second bounty, now 300. –MyTitle Jun 13 '13 at 8:20 add a comment| 5 Answers 5 active oldest votes up vote 3 down vote accepted +300 Your problem seems to be this: your intermediate scala files are not encoded correctly. Here is the process: Play takes your template file (foo.scala.html) and translates this into Scala: target/scala-2.10/src_managed/main/views/html/foo.template.scala. This then gets compiled by sbt to .class file
Sign in Pricing Blog Support Search GitHub This repository Watch 759 Star 8,475 Fork 2,922 playframework/playframework Code Issues 233 Pull requests 36 Projects 0 Pulse Graphs New issue 2.5.3 “IO error while decoding Routes.scala with UTF-8” when compiling Play Framework project #6147 Closed evandu opened this Issue May 11, 2016 · 4 comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned 2 participants evandu commented May 11, 2016 In my project, we have some Chinese comments in routes. But when we try to compile the source code, Play throws the following errors [error] IO error while http://stackoverflow.com/questions/16529753/scala-play-2-0-compilation-error-io-error-while-decoding decoding Routes.scala with UTF-8 [error] Please try specifying another one using the -encoding option [error] one error found [error] (demo/compile:compileIncremental) Compilation failed [error] Total time: 4 s, completed 2016-5-11 11:00:05 test routes is #优惠包编辑 GET /coupon/promotionCode/edit/:id coupon.PromotionCodeApplication.edit(id:String) after compile, the Routes.scala "GET", """@(优惠管理,优包惠编�?, coupon.group.edit)""", this.prefix + """coupon/group/edit/""" + "$" + """id<[^/]+>""" Play Framework member gmethvin commented May 12, 2016 • edited Hi @evandu, Is the routes file encoded as UTF-8? https://github.com/playframework/playframework/issues/6147 If so, can you provide a small sample project showing the error? evandu commented May 17, 2016 Hi @gmethvin sample project thanks Play Framework member gmethvin commented May 17, 2016 @evandu I think I know what the problem is. The routes compiler is using the default system encoding, which is what the JVM uses, but you are explicitly setting UTF-8 for just the scala compiler. What you can do is set the environment variable: JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8" That will tell Java to use UTF-8 as the default encoding in the JVM. I'm not sure this is something we can/should fix in Play. Unfortunately the scala compiler and java have two different ways of setting the encoding, and you have to make sure those are consistent. 👍 1 evandu commented May 17, 2016 Thanks a lot evandu closed this May 17, 2016 Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Sign in Pricing Blog Support Search GitHub This repository Watch 759 Star 8,475 Fork 2,922 playframework/playframework Code Issues 233 Pull requests 36 Projects https://github.com/playframework/playframework/issues/3017 0 Pulse Graphs New issue 2.3.0 won't support the UTF-8 characters in routes #3017 Closed zhengcan opened this Issue Jun 10, 2014 · 6 comments Projects None yet Labels needs-verification Milestone No milestone Assignees No one assigned 6 participants zhengcan commented Jun 10, 2014 In my project, we have some Chinese comments in routes. But when io error we try to compile the source code, Play throws the following errors. [error] IO error while decoding D:\Projects\...\target\scala-2.11\src_managed\main\routes_reverseRouting.scala with UTF-8 [error] Please try specifying another one using the -encoding option [error] IO error while decoding D:\Projects\...\target\scala-2.11\src_managed\main\routes_routing.scala with UTF-8 [error] Please try specifying another one using the -encoding option [error] two errors found [error] (compile:compile) Compilation failed [error] Total time: io error while 1 s, completed 2014-6-10 13:13:14 I've checked the content of routes_reverseRouting.scala, and found lots of wrong encoding characters in it. It must have a bug while generating these two files. jroper added the needs-verification label Jun 10, 2014 Play Framework member jroper commented Jun 10, 2014 Need to work out exactly how this regressed... probably need a fix similar to the one @pvlugter did for twirl. mickyp commented Jun 11, 2014 I have this problem too. After upgrading to 2.3 from 2.2.3, my comments in routes all make this error occurs. I am using Chinese too. After type in Japanese, the problem occur too. test routes is # Routes # This file defines all application routes (Higher priority routes first) # ~~~~ # Home page GET / controllers.OrderItems.index() # モナが第2子出産 再び山本に GET /orders/ controllers.OrderItems.list(page: Integer ?= 1) after compile, the generated routes_routing.scala // @LINE:9 private[this] lazy val controllers_OrderItems_newOrder1_route = Route("GET", PathPattern(List(StaticPart(Routes.prefix),StaticPart(Routes.defaultPrefix),StaticPart("orders/new")))) private[this] lazy val controllers_OrderItems_newOrder1_invoker = createInvoker( controllers.OrderItems.newOrder(), HandlerDef(this.getClass.getClassLoader, "", "controllers.OrderItems", "newOrder", Nil,"GET", """ ?��??�第2子出???�び山本??GET /orders/ controllers.OrderItems.list(page: Integer ?= 1)""", Routes.prefix + """orders/new""")) jroper added t