[GRADLE-1506] Jar, War, Ear tasks should use UTF-8 as default for file and directory naming Created: 02/May/11  Updated: 18/May/16  Resolved: 18/May/16

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-3
Fix Version/s: 2.14-rc-1

Type: Improvement
Reporter: Magnus Rundberget Assignee: Paul Merlin
Resolution: Fixed Votes: 4


The gradle jar task should (like Ant jar task) use UTF-8 for directory and file names.
(preferably you should be able to customize the encoding used as well...)

Currently if you have file names/directory names using "foreign"/non ansi characters in their names the jar task may end up messing up the file names.

So in my example I'm using gradle on windows (with cp1252). I've got java classes using norwegian characters in their names (æ, ø, å).

  • compiling the files works fine and the generated classes keep the correct characters
  • the jar task will "mangle" any filename with norwegian characters.

To get around this problem I had to add the following to the root build gradle file of my multiproject

System.setProperty("file.encoding", "UTF-8")

Comment by René Gröschke (Inactive) [ 18/Jan/13 ]

This issue seems to have the same root cause as described in GRADLE-2181

Comment by Mauro Molinari [ 20/Nov/14 ]

I also encountered this problem with Italian characters in file names.
Could you please fix this in Gradle?

Comment by Florian Kirmaier [ 01/May/15 ]

This issue cost me a half day ...
It would be realy great, if it could be fixed!

Comment by Mauro Molinari [ 04/Oct/15 ]

What's the exact relationship between this issue and the ZIP file naming improvement described in 2.8-rc-1 release notes?
Is that improvement supposed to be the "solution" to this?

Generated at Wed Jun 30 11:57:14 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.