Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sbt server displays weird characters around dates on Windows #7558

Open
segundovolante opened this issue May 12, 2024 · 6 comments
Open

Sbt server displays weird characters around dates on Windows #7558

segundovolante opened this issue May 12, 2024 · 6 comments
Labels

Comments

@segundovolante
Copy link

steps

Run sbt, for example

  • sbt compile

problem

Output display weird characters on the timestamps.

Total time: 1 s, completed May 12, 2024, 2:35:31 PM

image

This does not happen on WSL (ubuntu), same terminal same font.

image

expectation

Display date times without the extra characters:

Total time: 1 s, completed May 12, 2024, 2:35:31 PM

notes

@eed3si9n
Copy link
Member

Thanks for the report. Could you tell us what the environment that you are seeing this issue, for example the shell and the console program? Also could you check if this is specific to sbt 1.10.0 or it happens with previous versions?

@segundovolante
Copy link
Author

Both images are using Windows terminal. (Version: 1.20.11271.0)

  • Black background: Powershell 7.4.2 (Windows 11) . I can also reproduce this on regular CMD from windows.
  • Blue background: WSL - Ubuntu on windows terminal

Yes, I also see this happening on 1.9.9

@eed3si9n
Copy link
Member

So I'm guessing that "ΓÇ»" is either an ASCII control sequence or some string in encoding A, misinterpreted by your shell as another encoding B, also known as mojibakeh. If you have some override of JVM parameters, could you try adding -Dfile.encoding=UTF-8?

@segundovolante
Copy link
Author

segundovolante commented May 16, 2024

I ran it in verbose mode, I can see the encoding being UTF-8. I still see the issue.

❯ sbt -v
# Executing command line:
"C:\Program Files\Amazon Corretto\jdk21.0.3_9\bin\java.exe"
-Dfile.encoding=UTF-8
-Dscala.ext.dirs="C:\Users\username\.sbt\1.0\java9-rt-ext-amazon_com_inc__21_0_3"
-Xms1024m
-Xmx1024m
-Xss4M
-XX:ReservedCodeCacheSize=128m
-cp
"C:\Users\username\AppData\Local\Coursier\cache\arc\https\github.com\sbt\sbt\releases\download\v1.10.0\sbt-1.10.0.zip\sbt\bin\sbt-launch.jar"
xsbt.boot.Boot

@segundovolante
Copy link
Author

segundovolante commented May 16, 2024

unrelated, but I noticed that this does not work on powershell (it works on regular cmd)

sbt -Dfile.encoding=UTF-8

It throws this error:

[error] Not a valid command: UTF-8
[error] Not a valid project ID: UTF-8
[error] Expected ':'
[error] Not a valid key: UTF-8
[error] UTF-8
[error]  

It seems that on windows/powershell I am not able to override properties that contain a period.

This works:

sbt  -Dkey=value

@segundovolante
Copy link
Author

Hey I think i found the issue.

It uses this character NNBS, this can also be reproduced in scala-cli, or other java tool I think. This might be an issue on how java handles this in windows,.

val c: Char = 8239

I don't think it is specific to SBT, so you can probably close it, unless you want to display different format in windows compared to linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants