Unicode in variable names doesn't work
It gives an "Illegal start of simple pattern" error. The code otherwise compiles using SBT.
Example: val test_α = 3.0
Example: val test_α = 3.0
Leave a comment
This is likely an encoding problem. Check that your Eclipse install is correctly set to use UTF-8. It is explained how in the faq section about other unicode problems.
We should likely extend this entry for the reported test case.
We should likely extend this entry for the reported test case.
Ok, it appears that I had set the file to UTF8, but it requires the whole project to be set to UTF8 for it to actually compile. The UTF8 symbols were working in comments before that change though.
Perhaps the best solution is for me to follow up with the sbt-eclipse project to get UTF8 as the default at project creation time. Unless something similar makes sense as part of scala-ide defaults?
Perhaps the best solution is for me to follow up with the sbt-eclipse project to get UTF8 as the default at project creation time. Unless something similar makes sense as part of scala-ide defaults?
Looking into this further, it appears that people have been arguing about making UTF-8 the default in eclipse for a long time now (here).
The Scala spec in chapter 1, p3 states that scala programs are unicode, so the mac-roman default is always wrong when programming scala. I think when a scala project is created the settings should default to UTF-8.
The Scala spec in chapter 1, p3 states that scala programs are unicode, so the mac-roman default is always wrong when programming scala. I think when a scala project is created the settings should default to UTF-8.
Scalac actually allow to use a different encoding.
It kind of follows the logic of Eclipse (i.e. the bug report), and make as little sense to me.
–encoding <encoding>
Specify character encoding used by source files.
The default value is platform-specific (Linux: "UTF8", Windows: "Cp1252"). Executing the following code in the Scala interpreter will return the default value on your system:
scala> new java.io.InputStreamReader(System.in).getEncoding
It kind of follows the logic of Eclipse (i.e. the bug report), and make as little sense to me.
on 2013-04-10 15:21 *
By Iulian Dragos
..see discussion on sbt-eclipse: https://github.com/typesafehub/sbteclipse/pull/152
See the discussion for, perhaps, maybe, info on what is proprely an sbteclipse issue.