# Gradle Encoding Problem

**URL:** <https://discuss.gradle.org/t/gradle-encoding-problem/44019>\
**Category:** Help/Discuss\
**Created:** [October 10, 2022, 4:09pm UTC](https://discuss.gradle.org/t/gradle-encoding-problem/44019 "2022-10-10T16:09:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebaX94](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sebaX94](https://discuss.gradle.org/u/sebaX94)\
**Post date:** [October 10, 2022, 4:09pm UTC](https://discuss.gradle.org/t/gradle-encoding-problem/44019/1 "2022-10-10T16:09:56Z")

</div>

Hey Guys. I try to output a simple println(“äöü”) in Java. But i only get these Symbols “���” or Questionmarks. I execute my Gradle Project with the Gradle plugin “application”. First of all i thought its an Source Encoding or Compile Encoding Problem. But if i change the Encoding with compileJava.options.encoding = ‘example’, I get different Errors, which means the Command works.

I also tried:

```gradle
"-Dfile.encoding=UTF-8"

```

The command looks like doenst work:

```gradle
compileJava.options.encoding = 'UTF-8'
tasks.withType(JavaCompile) {
    options.encoding = 'UTF-8'
}

```

I will ad my Test Project here, so you can comprehend my Problem. [GitHub - sebaX94/Test](https://github.com/sebaX94/Test)

I use:  
VisualStudio Code, Eclipse IDE  
Java 18.0.2  
Gradle 7.4.2, Gradle 8.0 milestone2

---

<div class="post-metadata">

**Author:** ![Vampire](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/vampire/32/9082_2.png) [@Vampire](https://discuss.gradle.org/u/Vampire)\
**Post date:** [October 10, 2022, 7:20pm UTC](https://discuss.gradle.org/t/gradle-encoding-problem/44019/2 "2022-10-10T19:20:57Z")

</div>

Run through a debugger and verify whether the String is what you expect.  
If you see those question marks on the command line, you are most probable actually outputing the correct characters, but not in the encoding your command line interpreter is.  
If you for example output UTF-8 and your console is not configured to use UTF-8.  
That is then not a Gradle problem at all.

---

<div class="post-metadata">

**Author:** ![sebaX94](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@sebaX94](https://discuss.gradle.org/u/sebaX94)\
**Post date:** [October 11, 2022, 4:13pm UTC](https://discuss.gradle.org/t/gradle-encoding-problem/44019/3 "2022-10-11T16:13:54Z")

</div>

Okay. So i changed the cmd codepage with chcp 65001 to UTF8, executed the Project via cmd and still get these Symbols. What have I done wrong?

Edit: I installed IntelliJ and created a Project. For now it works. I dont know what I have done wrong by creating a Gradle Project with Eclipse. So Thread is solved and can be closed.
