row248
row248

Reputation: 411

IntelliJ IDEA embeded terminal output encoding issue

IDEA: IntelliJ IDEA 2018.2.3 x64
IDEA Embeded Terminal: "c:\cygwin64\bin\sh" -lic "cd ${OLDPWD-.}; bash"

I got build.gradle:

task info << {
    println "Привет, мир!"
}

When i run from embeded terminal gradle info i got output:

$ gradle info
Picked up JAVA_TOOL_OPTIONS: -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8

\> Task :info
╨Я╤А╨╕╨▓╨╡╤В, ╨╝╨╕╤А!

But if i run cat ./build.gradle:

$ cat ./build.gradle
task info << {
    println "Привет, мир!"
}

I googled that problem and solution with additional Custom VM Options for IDEA not worked

-Dfile.encoding=UTF-8
-Dconsole.encoding=UTF-8

Upvotes: 0

Views: 1809

Answers (1)

marme1ad
marme1ad

Reputation: 1383

It depends on where VM options were set actually.

Please call export GRADLE_OPTS="-Dfile.encoding=UTF8" before gradle info - it should fix it.


In case of Windows Terminal please use CP866 encoding instead of UTF-8 for cyrillic letters, so first command will look like this:

set GRADLE_OPTS="-Dfile.encoding=CP866"

Upvotes: 2

Related Questions