mysql> select '中文' regexp '[\u4e00-\u9fa5]';
+---------------------------------+
| '中文' regexp '[\u4e00-\u9fa5]' |
+---------------------------------+
| 0 |
+---------------------------------+
1 row in set (0.00 sec)
mysql> select 'zw' regexp '[\u4e00-\u9fa5]';
+-------------------------------+
| 'zw' regexp '[\u4e00-\u9fa5]' |
+-------------------------------+
| 1 |
+-------------------------------+
1 row in set (0.00 sec)
mysql> select '中文' not regexp '[\u4e00-\u9fa5]';
+--------------------------------------+
| '中文' not regexp '[\u4e00-\u9fa5]' |
+--------------------------------------+
| 1 |
+--------------------------------------+
1 row in set (0.00 sec)
为什么跟我理解的正好相反??
6 个解决方案
#1
检查一下字符集设置。
#2
+--------------------------+-----------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | e:\wamp\bin\mysql\mysql5.5.20\share\charsets\ |
+--------------------------+-----------------------------------------------+
数据库用的是utf8
请问应该怎么设置呢?
#3
显然不是UTF8
#4
显然不是UTF8
检查一下字符集设置。+--------------------------+-----------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | e:\wamp\bin\mysql\mysql5.5.20\share\charsets\ |
+--------------------------+-----------------------------------------------+
数据库用的是utf8
请问应该怎么设置呢?
整理那里不是 utf8-bin么?这不算是utf8格式么?
#5
什么原因呀,求关注呀
#6
问题解决了,不是什么字符集设置的问题的
具体看下面的连接
http://bbs.csdn.net/topics/390111997
具体看下面的连接
http://bbs.csdn.net/topics/390111997
#1
检查一下字符集设置。
#2
检查一下字符集设置。
+--------------------------+-----------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | e:\wamp\bin\mysql\mysql5.5.20\share\charsets\ |
+--------------------------+-----------------------------------------------+
数据库用的是utf8
请问应该怎么设置呢?
#3
检查一下字符集设置。+--------------------------+-----------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | e:\wamp\bin\mysql\mysql5.5.20\share\charsets\ |
+--------------------------+-----------------------------------------------+
数据库用的是utf8
请问应该怎么设置呢?
#4
显然不是UTF8
检查一下字符集设置。+--------------------------+-----------------------------------------------+
| Variable_name | Value |
+--------------------------+-----------------------------------------------+
| character_set_client | gbk |
| character_set_connection | gbk |
| character_set_database | latin1 |
| character_set_filesystem | binary |
| character_set_results | gbk |
| character_set_server | latin1 |
| character_set_system | utf8 |
| character_sets_dir | e:\wamp\bin\mysql\mysql5.5.20\share\charsets\ |
+--------------------------+-----------------------------------------------+
数据库用的是utf8
请问应该怎么设置呢?
整理那里不是 utf8-bin么?这不算是utf8格式么?
#5
什么原因呀,求关注呀
#6
问题解决了,不是什么字符集设置的问题的
具体看下面的连接
http://bbs.csdn.net/topics/390111997
具体看下面的连接
http://bbs.csdn.net/topics/390111997