regex - Got error 'invalid UTF-8 string at offset 1' from regexp
问题描述
I need help, I have tried to find the solution but until now all I have found is stuff related to regex but I think the problem might be in another place.
I have a project locally (Windows 10 --> Xampp Latest version [Apache & Mysql], I use CodeIgniter as Framework, I developed a function which searches in my database using REGEXP (I use query builder)
It works fine and everything. Here I searched for saltarín
<-- Note the accent on the letter i
So now that it works I have decided to update the online website but as soon as I was testing the online project I noticed an error jumps when I search something with accented characters or in this case the letter ñ
which also works locally.
I checked my database configurations, in database.php
I have dbcollat set to utf8_spanish_ci and my online database and tables are set to utf8_spanish_ci too, I think this must be a server configuration but I don't have an idea of what it really could be
In case you need it this is the piece of code which uses regexp
$this->db->where("lower(secret_colum_name) REGEXP", $this->secret_hehe);
Thanks a lot for your time, I really appreciate your help.
EDIT: I forgot to mention I'm using hostinger to host my website
解决方案
推荐阅读
- uikit - 如何将 UIImage 转换或加载到 PKDrawing 中?
- karate - 如果内容类型是 multipart/formdata,如何在空手道框架中发出 POST 请求?
- c# - 使用 Selectize.js 不会触发选择列表的 asp.net 核心客户端验证
- python - 为什么我的 python 代码没有执行,而是给了我一个“无”错误并且只执行了一部分?
- kubernetes - 如何在 GKE 上将 k-native 的最小比例设置为 1?
- mongodb - MongoDB:如何按一个字段分组,找到组中的最大字段并输出整条记录
- zapier - 我可以使用 python 代码输出来支持我的下一步吗?
- combinations - 是否有可能组建一支队伍,从我知道的其他 6 支队伍中击败至少 2-3 支队伍
- regex - 仅删除两个已知字符串之间的字符
- prolog - 如何正确过滤返回多个重复值的子句?