简体   繁体   中英

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

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM