From 1c869f25e43c4ffc4ff8cb4b6e9cd9f0b6430570 Mon Sep 17 00:00:00 2001 From: katzelda Date: Mon, 1 Mar 2021 14:48:06 -0500 Subject: [PATCH 1/2] force json export to be utf8 --- modules/ginas/app/ix/ginas/exporters/JsonExporter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ginas/app/ix/ginas/exporters/JsonExporter.java b/modules/ginas/app/ix/ginas/exporters/JsonExporter.java index 86a925986..98fcea3b7 100644 --- a/modules/ginas/app/ix/ginas/exporters/JsonExporter.java +++ b/modules/ginas/app/ix/ginas/exporters/JsonExporter.java @@ -10,6 +10,7 @@ import ix.core.controllers.EntityFactory; import ix.ginas.models.v1.Substance; +import org.jcvi.jillion.core.io.IOUtil; /** * Created by katzelda on 8/31/16. @@ -22,7 +23,8 @@ public class JsonExporter implements Exporter { public JsonExporter(OutputStream out) throws IOException{ Objects.requireNonNull(out); - this.out = new BufferedWriter(new OutputStreamWriter(out)); + //JSON must be in UTF-XX format + this.out = new BufferedWriter(new OutputStreamWriter(out, IOUtil.UTF_8_NAME)); } @Override public void export(Substance obj) throws IOException { From 6ad9183993c3d1c73974fbd5612694b1f6978721 Mon Sep 17 00:00:00 2001 From: katzelda Date: Mon, 1 Mar 2021 14:53:19 -0500 Subject: [PATCH 2/2] removed jillion dependency --- modules/ginas/app/ix/ginas/exporters/JsonExporter.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/ginas/app/ix/ginas/exporters/JsonExporter.java b/modules/ginas/app/ix/ginas/exporters/JsonExporter.java index 98fcea3b7..9b489d17e 100644 --- a/modules/ginas/app/ix/ginas/exporters/JsonExporter.java +++ b/modules/ginas/app/ix/ginas/exporters/JsonExporter.java @@ -10,7 +10,6 @@ import ix.core.controllers.EntityFactory; import ix.ginas.models.v1.Substance; -import org.jcvi.jillion.core.io.IOUtil; /** * Created by katzelda on 8/31/16. @@ -24,7 +23,7 @@ public class JsonExporter implements Exporter { public JsonExporter(OutputStream out) throws IOException{ Objects.requireNonNull(out); //JSON must be in UTF-XX format - this.out = new BufferedWriter(new OutputStreamWriter(out, IOUtil.UTF_8_NAME)); + this.out = new BufferedWriter(new OutputStreamWriter(out, "UTF-8")); } @Override public void export(Substance obj) throws IOException {