From 460c42bd215e235d5fc41a38a9f7c02eb3fee295 Mon Sep 17 00:00:00 2001 From: Michal Pawlicki <5757750+MichalPawlicki@users.noreply.github.com> Date: Sun, 28 Mar 2021 21:13:57 +0200 Subject: [PATCH] Specify charset of StringWritable and StringReadable --- geny/src/geny/Writable.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geny/src/geny/Writable.scala b/geny/src/geny/Writable.scala index d32d911..c5d9266 100644 --- a/geny/src/geny/Writable.scala +++ b/geny/src/geny/Writable.scala @@ -33,7 +33,7 @@ object Writable extends LowPriWritable { s.grouped(8192).foreach(ss => out.write(ss.getBytes(StandardCharsets.UTF_8))) } - override def httpContentType = Some("text/plain") + override def httpContentType = Some("text/plain; charset=utf-8") override def contentLength = Some(Internal.encodedLength(s)) } @@ -97,7 +97,7 @@ object Readable{ def readBytesThrough[T](f: InputStream => T): T = { f(new ByteArrayInputStream(s.getBytes(StandardCharsets.UTF_8))) } - override def httpContentType = Some("text/plain") + override def httpContentType = Some("text/plain; charset=utf-8") override def contentLength = Some(Internal.encodedLength(s)) }