fix unicode char issues
This commit is contained in:
parent
185caeeac3
commit
201b01db4c
@ -21,18 +21,17 @@ use JsonException;
|
|||||||
class Json implements RendererInterface
|
class Json implements RendererInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param $rows
|
* @param iterable $rows
|
||||||
* @param $fieldNames
|
* @param iterable $fieldNames
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
* @throws RenderException
|
* @throws RenderException
|
||||||
*/
|
*/
|
||||||
public function getContent($rows, $fieldNames): string
|
public function getContent( iterable $rows, iterable $fieldNames): string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$flags = JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR;
|
$flags = JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES;
|
||||||
$json = json_encode($rows, $flags);
|
return json_encode($rows, $flags);
|
||||||
return $json;
|
|
||||||
} catch (JsonException $e) {
|
} catch (JsonException $e) {
|
||||||
/** @var RenderException $newException */
|
/** @var RenderException $newException */
|
||||||
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e);
|
$newException = oxNew(RenderException::class, $e->getMessage(), $e->getCode(), $e);
|
||||||
|
Loading…
Reference in New Issue
Block a user