On 14 Jan 2014, at 3:33 am, Yu Nobuoka <nobuoka+...@vividcode.info> wrote:

> Adam Murdoch wrote
>> I think we should simply have all Gradle scripts use utf-8 encoding,
>> rather than make this configurable.
> 
> Indeed it is one of the ways to avoid problems with encoding of Gradle
> scripts, but there remains the problem that current Gradle system doesn't
> always read Gradle scripts using UTF-8 encoding. (Current Gradle system read
> Gradle scripts using default file encoding.)

We’d change the code, of course, and quite possibly exactly how you’ve 
suggested below.

The question is more whether this is too big a breaking change to make in a 
Gradle 1.x release, or whether it should wait for a 2.0 release.

> 
> Supposing Gradle system supports only Gradle scripts with UTF-8 encoding, I
> propose changing  the statement `IOUtils.toString(inputStream)` on
> UriResource#getText method
> <https://github.com/nobuoka/gradle/blob/2d826b213293995f60ca80891094ca201acd8cf7/subprojects/core/src/main/groovy/org/gradle/api/internal/resource/UriResource.java#L60>
>   
> into `IOUtils.toString(inputStream, "UTF-8")`.
> 
> (I am troubled by this problem when using Gradle on Windows (because its
> default file encoding is not UTF-8). I know that there is a workaround
> (setting
> `-Dfile.encoding=UTF-8`
> in the `GRADLE_OPTS` env var), but its side effect is not wanted.)
> 
> 
> 
> --
> View this message in context: 
> http://gradle.1045684.n5.nabble.com/Proposal-way-to-set-an-encoding-of-a-Gradle-build-script-tp5712199p5712205.html
> Sent from the gradle-dev mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
> 
>    http://xircles.codehaus.org/manage_email
> 
> 


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com



Reply via email to