Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing utf-8 strings between php and javascript

I'm having problems passing utf-8 strings to javascript (ajax). Currently i'm using rawurlencode on the PHP side and unescape on the javascript side.

The problem is in latin and rawurlencode doesn't support it fully.

Is there any alternative or any better option?

like image 473
Mission Avatar asked Jul 10 '26 16:07

Mission


1 Answers

The solution was in json_encode functions. The problems stopped when i added JSON_HEX_APOS|JSON_HEX_QUOT.

Thanks!

like image 65
Mission Avatar answered Jul 13 '26 10:07

Mission