The server-side PHP script accepts requests from clients in C ++ ... In the header there is a parameter Name: имя_пользователя , which becomes null when json_encode . If you look at the client's exe-file in notepad ++, it is in windows-1251 encoding (the parameters are appended to the end of the client and it reads itself to initialize the variables). Naturally json_encode requires utf-8. Attempts to convert to utf-8 on the server side using utf8_encode or mb_convert_encoding yielded something incomprehensible at the output, and not Russian text (although not null already). mb_detect_encoding when receiving this parameter returns UTF-8 although json_encode still writes null
How to get out of this situation? Is it possible to solve the problem in php or is it necessary to write a function of the type string_cp1251_to_string_utf8 for one single variable in the client?