Re: Searching/inserting certain Unicode characters
You have a UTF8 column, so first you have to know
what the UTF8 encoding is for U+00A0. You can look
it up, or you can do the conversion in SQL, e.g.
mysql> select hex(cast(_ucs2 0x00a0 as char character set utf8));
+----------------------------------------------------+
| hex(cast(_ucs2 0x00a0 as char character set utf8)) |
+----------------------------------------------------+
| C2A0 |
+----------------------------------------------------+
1 row in set (0.00 sec)
And to insert that, you just precede it with '0x', e.g.
mysql> create table table_name (utf8 char(5) character set utf8);
Query OK, 0 rows affected (0.04 sec)
mysql> INSERT INTO table_name VALUES (0xC2A0);
Query OK, 1 row affected (0.00 sec)
mysql> SELECT hex(utf8) FROM table_name WHERE utf8 = 0xC2A0;
+-----------+
| hex(utf8) |
+-----------+
| C2A0 |
+-----------+
1 row in set (0.00 sec)
Peter Gulutzan
MySQL / Oracle
Subject
Views
Written By
Posted
18244
February 14, 2011 09:48AM
4323
February 16, 2011 01:03AM
3448
February 21, 2011 08:17AM
3065
February 23, 2011 04:06PM
2779
February 23, 2011 05:21PM
2834
February 23, 2011 10:14PM
Re: Searching/inserting certain Unicode characters
4207
February 17, 2011 06:34PM
3326
February 21, 2011 07:49AM
2431
February 27, 2011 11:43AM
2422
February 27, 2011 01:14PM
2881
March 06, 2011 01:48PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.