From: Jussi Koskela Date: Thu, 22 Aug 2019 11:02:13 +0000 (+0300) Subject: Use UTF-8 charset in SVG byte[] to String conversion X-Git-Tag: v1.43.0~136^2~97 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=968b2bf33a1d39267f8e15776cb5c0ebf9a5521e;p=simantics%2Fplatform.git Use UTF-8 charset in SVG byte[] to String conversion Suggestions for API cleanup listed in the issue description. gitlab #358 Change-Id: I79c3a8f25f3ad679a5699bf43e689474fbe421f4 --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/svg/CreateSVGElement.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/svg/CreateSVGElement.java index 1f302a64d..92dbe16a6 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/svg/CreateSVGElement.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/svg/CreateSVGElement.java @@ -2,6 +2,7 @@ package org.simantics.modeling.svg; import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import org.simantics.databoard.Bindings; import org.simantics.db.Resource; @@ -35,7 +36,7 @@ public class CreateSVGElement { g.claimValue(transform, new double[] {1.0, 0.0, 0.0, 1.0, mposX, mposY}, Bindings.DOUBLE_ARRAY); element = GraphUtils.create(g, L0.InstanceOf, DIA.SVGElement, - G2D.HasSVGDocument, new String(data), + G2D.HasSVGDocument, new String(data, StandardCharsets.UTF_8), DIA.HasTransform, transform); AddElement.claimFreshElementName(g, diagram, element); } else if ("png".equals(suffix)) {