How to serialize JSON with json4s with UTF-8 characters?
<p>I have a really simple example:</p>

<pre><code>import org.json4s._
import org.json4s.native.JsonMethods._
import org.json4s.JsonDSL._

val json = ("english" -&gt; JString("serialization")) ~ ("japanese" -&gt; JString("シリアライゼーション"))

println(pretty(render(json)))
</code></pre>

<p>What I get out of that is:</p>

<pre><code>{
  "english":"serialization",
  "japanese":"\u30b7\u30ea\u30a2\u30e9\u30a4\u30bc\u30fc\u30b7\u30e7\u30f3"
}
</code></pre>

<p>What I want is this (perfectly valid AFAIK) JSON:</p>

<pre><code>{
  "english":"serialization",
  "japanese":"シリアライゼーション"
}
</code></pre>

<p>I can't find it now, but I think I've read somewhere that JSON only requires two special UTF-8 characters to be escaped.</p>

<p>Looking at the code for <a href="https://github.com/json4s/json4s/blob/3.4/native/src/main/scala/org/json4s/native/JsonMethods.scala#L40" rel="nofollow noreferrer">render</a>, it appears that <a href="https://github.com/json4s/json4s/blob/3.4/core/src/main/scala/org/json4s/ParserUtil.scala#L37" rel="nofollow noreferrer">Strings always get this extra double-escaping for non-ASCII characters</a>.</p>

<p>Anyone know how I can get valid JSON without double-escaping all the UTF-8 extended characters? This seems like a very similar issue to: <a href="https://stackoverflow.com/questions/16498286/why-does-the-php-json-encode-function-convert-utf-8-strings-to-hexadecimal-entit">Why does the PHP json_encode function convert UTF-8 strings to hexadecimal entities?</a></p>

<hr>

<p><strong>Update</strong>: It turns out this is an open issue in json4s with a pending <a href="https://github.com/json4s/json4s/pull/327" rel="nofollow noreferrer">PR #327</a> which was closed in favor of <a href="https://github.com/json4s/json4s/pull/339" rel="nofollow noreferrer">PR #339</a> which in turn merged into the 3.4 release branch in a <a href="https://github.com/json4s/json4s/pull/339/files#r60582054" rel="nofollow noreferrer">commit on Feb 13, 2016</a>.</p>