0

on shared apache server which host my website I can not set default server settings to utf-8

and in PHP json_encode return encoded utf-8 string from text like: مرتضی to : \u0645\u0631\u062a\u0636\u06cc

how can I prevent this or how return it back to original text encoding?

1 Answers1

1

Just use the JSON_UNESCAPED_UNICODE flag:

echo json_encode($str, JSON_UNESCAPED_UNICODE);
Olivier
  • 13,283
  • 1
  • 8
  • 24