PHP: weird string encoding in $ _GET

I have the following line sent by the server to the client:

3%D3%E1f%7C%AF%B0a%B58%81%92%F9M%90%0CD%A0Y%9C // string in the actual URL
3Óáf|¯°aµ8’ùMD Yœ // var_dump($_GET)

The source line should be:

33D3E1667CAFB061B5388192F94D900C44A0599C

My problem is that I cannot figure out how to encode / decode this so that I can display the search in the database because the sort type does not match. I tried urlencode/ urldecode, mb_string_convert, utf8_encode, iconv, but with no luck. Any ideas?

Laravel throws the following exception when trying to use a string to search:

'SQLSTATE[HY000]: General error: 1267 Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE)...

I do not control what client coding is. The strange value is to register it in a log file usingLaravel Log::imfo()

+4
source share
2 answers

, bin2hex().

+1

.

, , UTF-8 ( , - ).

+2

Source: https://habr.com/ru/post/1622343/


All Articles