actions-on-google / actions-on-google-java

Java/Kotlin library for Actions on Google
Apache License 2.0
286 stars 39 forks source link

German umlauts (ä, ö and ü) not properly displayed and spoken. #63

Open Binozo opened 3 years ago

Binozo commented 3 years ago

Hello, there is an issue with German umlauts. When you send a response with ä, ö or ü, Google Assistant will not pronounce and display them correctly. For example, "ü" is displayed and spoken as "ü". I found no information about this and I found nothing in the settings.

I tried to use the right charset for this. String response = new String(responseBody.getBytes(StandardCharsets.UTF_8)); And the Text is displayed correctly in the console. (When I debug it locally) {"fulfillmentText":"Diese Funktion wird derzeit noch nicht unterstützt...

Before I set the charset: -> {"fulfillmentText":"Diese Funktion wird derzeit noch nicht unterst�tzt... After I set the charset: -> {"fulfillmentText":"Diese Funktion wird derzeit noch nicht unterstützt...

But the issue is, Google Assistant doesn't receive the Text correctly. grafik

Any ideas how to fix this?

Binozo commented 3 years ago

Update: This worked locally but not on production: resp.getOutputStream().write(new String(("" + responseBody).getBytes(StandardCharsets.UTF_8), StandardCharsets.UTF_8).getBytes());

The biggest pain in the ass I've ever had. grafik

Binozo commented 3 years ago

I removed these lines resp.setContentType("application/json; charset=UTF-8"); resp.setCharacterEncoding("UTF-8");

and it started working.

grafik

The Problem is, ä, ö and ü is UTF-8. This is ridiculous.

Binozo commented 3 years ago

Still same issue