-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Default file encoding for daemon should be UTF-8 #2270
Comments
Cannot set UTF-8 properties in gradle.properties if Windows is used for compilation - it read them as CP-1251 (in my case) |
Any roadmap for this? |
Related issue: #19952 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently we don't set the
file.encoding
property when starting daemons. Most systems default to UTF-8, but Windows typically uses CP-1252. The difference in default encoding can produce incorrect results by reusing cached task outputs from a shared cache when used by different OSs.The real solution is for tasks to always declare all their inputs, even the default file encoding if they rely on it. However, this is easy to forget, as even some built-in tasks in Gradle don't do this (these should be fixed as a separate issue). By defaulting to UTF-8 we are making this discrepancy go away.
Users who need to set a different default encoding can make it explicit via
org.gradle.jvmargs=-Dfile.encoding=...
.Expected Behavior
Daemon is started with
utf-8
as the default encoding.Current Behavior
Daemon is started with the system default encoding. Changing the system default encoding does not change the default encoding for an already running daemon.
Context
Tasks that rely on
file.encoding
but don't declare it as an input can reuse cached results produced with a default encoding.The text was updated successfully, but these errors were encountered: