Skip to content

scala-cli setup-ide generates files in latin-1 instead of utf-8 #2598

@JD557

Description

@JD557

Version(s)
v1.1.0

Describe the bug

scala-cli setup-ide generates .bsp/scala-cli.json in latin-1, while it should be encoded in UTF-8 (I was unable to check the other files).
This breaks the integration with metals for users with a home on a non-ASCII path.

To Reproduce

  • Set your scala-cli instalation directory to somewhere with a non-ASCII character (in my case: C:\Users\João\AppData\Local\Coursier\data\bin\.scala-cli.aux.exe)
  • Run scala-cli setup-ide
  • Check the .bsp/scala-cli.json file (in my case, the ã was encoded as 0xe3)

Expected behaviour

I would expect the file to be encoded in UTF-8.

In my case, I would expect the ã to be encoded as either 0xc3 0xa3 (LATIN SMALL LETTER A WITH TILDE) or 0x61 0xcc 0x83 (LATIN SMALL LETTER A with COMBINING TILDE).

scala-cli setup-ide . --charset utf-8 seems to do the trick. I would expect this to be the default, as metals won't work otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions