PHP 7.1 decode emoji sent by JS

95 views Asked by At

I've sent a query string like this by JS to a PHP 7.1 app

?com=item&title=Hello%uD83D%uDE99

and should get

Hello

but it is

Hello??????

Please F1...:)

I use JSHttpRequest class to do so

Thanks

1

There are 1 answers

0
sam On

Added this line:

this.queryText = this.queryText.replace(/\%(u[0-9a-f]{4})/ig, '\\$1');

before

xr.send(this.queryText);
this.span = null;

in JsHttpRequest.js:422 to fix query string

ThanX to all