]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Use UTF-8 charset in SVG byte[] to String conversion 44/3144/3
authorJussi Koskela <jussi.koskela@semantum.fi>
Thu, 22 Aug 2019 11:02:13 +0000 (14:02 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 23 Aug 2019 11:35:14 +0000 (11:35 +0000)
Suggestions for API cleanup listed in the issue description.

gitlab #358

Change-Id: I79c3a8f25f3ad679a5699bf43e689474fbe421f4

bundles/org.simantics.modeling/src/org/simantics/modeling/svg/CreateSVGElement.java

index 1f302a64db4c2b7262339366bdb438123e7b3d11..92dbe16a65e9b383c7a923d572d3f9bd6d26d92d 100644 (file)
@@ -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)) {