【问题标题】:Cannot Save native language (Telugu) from Code Igniter to MYSQL database无法将本地语言(泰卢固语)从 Code Igniter 保存到 MYSQL 数据库
【发布时间】:2020-06-23 08:41:09
【问题描述】:

我正在开发一个 PHP API 和一个 CodeIgniter 网站,我需要向数据库(MYSQL)发布/获取一个表单,我为 Android 编写了直接 API,不使用任何框架但工作正常。

PHP API POST 请求代码:

$postDescription = strip_tags($_REQUEST['postDescription']);
$stmtl = $user->runQuery("INSERT INTO posts(postID,userID,postDescription) VALUES('','".$userID."','".$postDescription."')");

网站的 CodeIgniter 代码:

$data = array('postDescription' => $this->input->post('postDescription'),);
return $this->db->insert('posts', $data);

问题是本地语言的帖子数据内容可以很好地插入和获取数据库,但是在从codeigniter网站发布时会像这样的内容????????或显示来自 android 发布内容的数据,如 °¤à°¾à°¡à±‡à°ªà°²à±à°²à°¿ à°•à±à°¯à°¾à°‚à°ªà

我需要在安卓和网站之间发布/显示母语内容。

演示网址:http://arunahospitals.com/

【问题讨论】:

  • 这个标题你试过了吗('Content-type: text/html; charset=utf-8');
  • 确保你的表的联盟是utf8mb4
  • 尝试了这两个选项!发布的数据只能对那些(android,web)可见

标签: php mysql codeigniter user-input utf


【解决方案1】:

您可以将 database->table->column's 排序规则属性更改为 utf16/utf32 。假设您的列名称为“posts”,那么您可以尝试将列“posts”归类属性更改为utf16/utf32

【讨论】:

  • 已更改为 utf16 但同样的错误,android 发布的 android 对 android 可见,codeigniter 发布的数据仅对 web 可见
  • 在MySQL专栏中:来自codeigniter post的数据保存为రిపోర్ట్స్, వీడియోలు,原始原生原生,来自Android的数据通过PHP API保存为పోరà±à °Ÿà±à°¸à±, à
  • 你试过 utf32 @Sailesh 吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-11-27
相关资源
最近更新 更多