playframework/playframework — pull request #1620 by richdougherty (2013-09-10 05:23:45+00:00)
Title: JLine command history broken on Windows

This behaviour can be reproduced on Windows with vanilla SBT 0.13.0 by providing `file.encoding=UTF-8` as an option:

````
>set JAVA_OPTS=-Dfile.encoding=UTF-8
>sbt
[info] Set current project to project (in build file:/C:/p/ansi/ansi2/project/)
> ∩┐╜
````

It does *not* occur with SBT 0.12.4, which is why this wasn't a problem for Play 2.1.

Removing the `file.encoding` option from Play's build.bat resolves the problem, but I guess we need that option for some reason, e.g. Scala compilation.

A quick search for "jline file.encoding" showed me:

http://jline.sourceforge.net/apidocs/src-html/jline/WindowsTerminal.html
```
192 String encoding = System.getProperty("jline.WindowsTerminal.input.encoding", System.getProperty("file.encoding"));
193 ReplayPrefixOneCharInputStream replayStream = new ReplayPrefixOneCharInputStream(encoding);
```
So there is an option to set the JLine encoding directly, but how can you set it to `null` while still setting `file.encoding`?

It looks like Spring Roo couldn't find a solution to the problem when they tried to solve it in 2009.
https://jira.springsource.org/browse/ROO-439

Definitely needs more investigation.