Skip to content

cannot find the path specified with UTF-8 characters on Windows #3307

Open
@Gedochao

Description

@Gedochao

Version(s)
1.4.3, scala-cli as scala 3.5.2

Describe the bug

On Windows, if the user directory has an umlaut in it (e.g. 'ä'), the scala.bat file will not work properly and simply output:
The system cannot find the path specified.

To Reproduce

 > scala
The system cannot find the path specified.

Workaround

There are two problems in the batch file. One is, that the umlaut 'ä' was changed to '�' on the line SET CMDLINE="C:\Users\<name with ä>.

Note: I don't know where exactly this issue stems from.

Another issue is that the code page has to be set to 65001 to execute properly.
This can be done by adding the following line at the top of the file:

@CHCP 65001>nul

The command CHCP 65001 changes the code page to 65001 and the rest disables the lines output (@echo off is not enough here).
? > Note: This worked for me, but could break things on other systems.

Expected behaviour

The scala repl starts:

Welcome to Scala 3.5.2 (23.0.1, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala>

Extra context

Metadata

Metadata

Labels

REPLIssues tied with the repl sub-command.bugSomething isn't workingwindowsWindows-specific issues

Type

No type

Projects

Status

To do

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions