diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/impl/util/GrafanaRequestHandlerUtil.java b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/impl/util/GrafanaRequestHandlerUtil.java index 064ea037f46..e4d17265a8c 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/impl/util/GrafanaRequestHandlerUtil.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/analytics/mgt/grafana/proxy/api/service/impl/util/GrafanaRequestHandlerUtil.java @@ -46,6 +46,7 @@ import javax.ws.rs.core.UriInfo; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; @@ -138,7 +139,7 @@ public class GrafanaRequestHandlerUtil { } public static void setRequestEntity(HttpPost postRequest, JsonObject body) throws UnsupportedEncodingException { - StringEntity bodyEntity = new StringEntity(body.toString()); + StringEntity bodyEntity = new StringEntity(body.toString(), StandardCharsets.UTF_8); bodyEntity.setContentType(MediaType.APPLICATION_JSON); postRequest.setEntity(bodyEntity); } diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java index 3ac99b10443..6cd8872eae0 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/GrafanaHandler.java @@ -48,6 +48,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.URI; +import java.nio.charset.StandardCharsets; @MultipartConfig @WebServlet( @@ -150,6 +151,7 @@ public class GrafanaHandler extends HttpServlet { resp.setContentType(contentType); resp.setStatus(grafanaAPIResponse.getCode()); addXFrameOptionsHeaders(resp); + resp.setCharacterEncoding(StandardCharsets.UTF_8.name()); resp.getWriter().print(grafanaAPIResponse.getData()); }