actions-on-google-java icon indicating copy to clipboard operation
actions-on-google-java copied to clipboard

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

Open Binozo opened this issue 4 years ago • 3 comments

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 avatar Sep 04 '21 16:09 Binozo

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 avatar Sep 04 '21 20:09 Binozo

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 avatar Sep 04 '21 20:09 Binozo

Still same issue

Binozo avatar Sep 22 '21 15:09 Binozo