From 968b2bf33a1d39267f8e15776cb5c0ebf9a5521e Mon Sep 17 00:00:00 2001 From: Jussi Koskela Date: Thu, 22 Aug 2019 14:02:13 +0300 Subject: [PATCH] Use UTF-8 charset in SVG byte[] to String conversion Suggestions for API cleanup listed in the issue description. gitlab #358 Change-Id: I79c3a8f25f3ad679a5699bf43e689474fbe421f4 --- .../src/org/simantics/modeling/svg/CreateSVGElement.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) { -- 2.47.1