Add JSON_UNESCAPED_UNICODE as default flag for json convert to array calls
This commit is contained in:
@@ -55,10 +55,10 @@ class Json
|
|||||||
* Deos not throw errors
|
* Deos not throw errors
|
||||||
*
|
*
|
||||||
* @param array<mixed> $data
|
* @param array<mixed> $data
|
||||||
* @param int $flags json_encode flags as is
|
* @param int $flags [JSON_UNESCAPED_UNICODE] json_encode flags as is
|
||||||
* @return string JSON string or '{}' if false
|
* @return string JSON string or '{}' if false
|
||||||
*/
|
*/
|
||||||
public static function jsonConvertArrayTo(array $data, int $flags = 0): string
|
public static function jsonConvertArrayTo(array $data, int $flags = JSON_UNESCAPED_UNICODE): string
|
||||||
{
|
{
|
||||||
$json_string = json_encode($data, $flags) ?: '{}';
|
$json_string = json_encode($data, $flags) ?: '{}';
|
||||||
self::$json_last_error = json_last_error();
|
self::$json_last_error = json_last_error();
|
||||||
|
|||||||
Reference in New Issue
Block a user