[2.0] Template conversion bug

153 views
Skip to first unread message

Etam

unread,
Dec 21, 2011, 5:45:59 PM12/21/11
to play-fr...@googlegroups.com
Hi,

I think that this might be a bug:

While converting UTF-8 template from scala.html to template.scala 'ń' is replaced with .

Example:
scala.html: <input type="submit" value="Usuń" class="btn danger">
template.scala: <input type="submit" value="Usu�" class="btn danger">

Then I get compilation error:

IO error while decoding /../secretariatus/target/scala-2.9.1/src_managed/main/views/html/editForm.template.scala with UTF-8 Please try specifying another one using the -encoding option

Guillaume Bort

unread,
Dec 22, 2011, 4:13:31 AM12/22/11
to play-fr...@googlegroups.com
As in Play 1.x source files must be utf-8 encoded.

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/play-framework/-/h6aHDIUhwIkJ.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.

--
Guillaume Bort

Etam

unread,
Dec 22, 2011, 12:39:48 PM12/22/11
to play-fr...@googlegroups.com
As in Play 1.x source files must be utf-8 encoded.

All source files are UTF-8 encoded ('ń' is a valid UTF-8 character). 

Guillaume Bort

unread,
Dec 22, 2011, 1:00:03 PM12/22/11
to play-fr...@googlegroups.com
Ok. Which version are you using? Can you check that your
framework/build file contains this option:

-Dfile.encoding=UTF8

On Thu, Dec 22, 2011 at 6:39 PM, Etam <odwr...@gmail.com> wrote:
>> As in Play 1.x source files must be utf-8 encoded.
>
>
> All source files are UTF-8 encoded ('ń' is a valid UTF-8 character).
>

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To view this discussion on the web visit

> https://groups.google.com/d/msg/play-framework/-/xXW0OP2yDIgJ.

Johannes Emerich

unread,
Mar 19, 2012, 7:58:00 AM3/19/12
to play-fr...@googlegroups.com
Hi,

I had the same issue, source files encoded in UTF-8, compiled files with broken encoding. I found a solution which might help figuring out the problem, also.

This was using the sbt plugin version of Play 2.0 final, i.e. running `sbt`, not `play` from the command line:

  $ file -I app/views/admin/Hierarchy/order.scala.html
  app/views/admin/Hierarchy/order.scala.html: text/html; charset=utf-8

  $ file -I target/scala-2.9.1/src_managed/main/views/html/admin/Hierarchy/order.template.scala
  target/scala-2.9.1/src_managed/main/views/html/admin/Hierarchy/order.template.scala: text/html; charset=utf-8

I then downloaded the Play 2.0 ZIP from the website and started the application using the `play` executable, and the problem disappeared. The `play` script sets the file.encoding option when running sbt, but I suppose the play plugin does not.

Best,
Johannes
Reply all
Reply to author
Forward
0 new messages