回车 Return 检测为 Unicode

Carriage Return Detecting as Unicode

我正在将此 SMS Counter PHP Class Library 用于我的一个项目。

$msg = $_REQUEST['msg'];
$scounter = SMSCounter::count(utf8_urldecode($msg));

当我在 msg 文本区域中使用 Carriage ReturnEnter 键时,它被检测为 Unicode,因此我的消息计数被折腾了。根据 class,它将消息计为 / 67 个字符的 Unicode 并计数 4 次。

我从昨天开始就在谷歌上搜索了一个解决方案,但我无法理解,我怎么能阻止库 class 将 Carriage ReturnEnter 键视为 GSM_7bit统一码。

请帮忙!

将 chr(13) 添加到您的 7Bit 映射功能,它将检测为 GSM 7Bit。

public static function int_gsm_7bit_map(){
    return array(10,13,32.........

希望对您有所帮助。