【发布时间】:2016-07-21 10:30:58
【问题描述】:
我正在尝试用非英语 utf8 语言的波斯语编写一个 php 电报机器人。 当我尝试将波斯语的纯文本发送给我的客户时,它工作得很好
$array = [
"chat_id" => $chat_id,
"text" => $someNonEnglishText
];
$telegram->sendMessage($array);
但是当我尝试使用下面的代码发送键盘数据时,它只会显示一些问号,例如????????????????在我的键盘按钮上
$reply_markup = $telegram->replyKeyboardMarkup([
'keyboard' => $someNonEnglishkeyboard,
'resize_keyboard' => true,
'one_time_keyboard' => true
]);
$telegram->sendMessage([
'chat_id' => $updates[0]->getMessage()->getChat()->getId(),
'text' => $something,
'reply_markup' => $reply_markup
]);
通过在终端中运行以下命令,我完全确定我的 bot php 文件是 utf8 文件 myfile.php 虽然我得到了答案: surveyBot.php:PHP 脚本,UTF-8 Unicode 文本
有人可以帮忙吗?
ps:上面的代码在英文键盘上运行得很好。
【问题讨论】:
标签: php utf-8 keyboard telegram-bot non-english