Why is urlencode not working when posting message in Arabic via Telegram bot?

$message is retrieved from mysql db

The db tables have utf8_general_ci as character encoding

The following is executed with each connection:

mysqli_query($this->link,"set character set utf-8");

The php file is encoded utf-8


When the following command is used:

echo $response = file_get_contents
("". $message);

If retrieved $message is stored in English: it works

If $message is stored in Arabic: it doesn’t work

If $message is entered in Arabic in the file itself (not retrieved from db): it works

What is wrong? I would appreciate your help!


help you find a teacher at any aspect

Use third party library meets error "No rule to make target"