Closed MrFallen closed 5 years ago
Please provide examples of servers.
The problem is that GameQ runs UTF-8 by default. Russian SAMP servers return data encoded in Windows-1251. You can apply a filter that will detect data encoded in Windows-1251 and reencoding them to UTP-8. But this is a shit decision.
SAMP does not force the character encoding to UTF-8. It is probably coming back from the server with that character encoding.
Please send over a server with the issue so we can test. Would like to make sure the data coming back is correct and that you just need to convert the encoding on the results.
@Austinb 46.174.48.144:8904
So after looking at this the host name is coming back with hex characters which should be converted into utf8 to make it the same as the rest of the protocols. I will make the changes to convert them from hex to utf8 at which point you can use mb_convert_encoding() to convert it from utf8 to Windows-1251 which will give you the proper Russian characters.
For that server the raw response in the results array should be something like Village RolePlay | Àêöèÿ õ2
Example converting to proper encoding to show the proper Russian characters - mb_convert_encoding($server_name, "Windows-1251", "utf-8")
So after looking at this the host name is coming back with hex characters which should be converted into utf8 to make it the same as the rest of the protocols. I will make the changes to convert them from hex to utf8 at which point you can use mb_convert_encoding() to convert it from utf8 to Windows-1251 which will give you the proper Russian characters.
For that server the raw response in the results array should be something like
Village RolePlay | Àêöèÿ õ2
Example converting to proper encoding to show the proper Russian characters -
mb_convert_encoding($server_name, "Windows-1251", "utf-8")
the problem is still relevant with Russian characters
У меня получилось исправить кодировку следующим образом:
header('Content-Type:text/html; charset=utf-8'); $server_name = iconv('utf-8//IGNORE', 'cp1252//IGNORE', $server_name); $server_name = iconv('cp1251//IGNORE', 'utf-8//IGNORE', $server_name);
SAMP does not work with Russian characters in the server name. :(