X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.graph.compiler%2Fsrc%2Forg%2Fsimantics%2Fgraph%2Fcompiler%2Finternal%2FresourceFiles%2FResourceFile.java;h=d9d155037e1eadd3b624cca948bcd95394676afb;hb=f9b0a9c48dd040142414f8d3e7ac43b502d3e203;hp=25758343d59751d3dd2a5d28d2aac8d950485ebe;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/ResourceFile.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/ResourceFile.java index 25758343d..d9d155037 100644 --- a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/ResourceFile.java +++ b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/resourceFiles/ResourceFile.java @@ -6,6 +6,7 @@ import java.io.OutputStreamWriter; import java.io.StringWriter; import java.io.Writer; import java.net.URL; +import java.nio.charset.Charset; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -19,6 +20,8 @@ import freemarker.template.DefaultObjectWrapper; import freemarker.template.Template; public class ResourceFile implements IResourceFile { + private final static Charset UTF8 = Charset.forName("UTF-8"); + String packageName; String className; List resources; @@ -88,8 +91,8 @@ public class ResourceFile implements IResourceFile { @Override public InputStream getContent() { StringWriter writer = new StringWriter(); - write(writer); - return new ByteArrayInputStream(writer.toString().getBytes()); + write(new FilterCRWriter(writer)); + return new ByteArrayInputStream(writer.toString().getBytes(UTF8)); } /* (non-Javadoc)